standard input and output question 
Author Message
 standard input and output question

Hello,

I am a dummy in ShellScript.

How to send the INPUT parameter to a program when it ask for input ?
for example, just like "ftp", when I type "ftp localhost", it will ask for
username and password.
How to send the username and password to that ?

-------------------------------------------------------------------
#!/bin/sh

HOST="192.168.0.1"
USER="eric"
PASS="eric"

#....( I don't know how to implement it for connectint to a FTP server)
#Would you please to show me how to automatic connect to a FTP server with a
script by providing HOSTNAME, # USERNAME and PASSWORD as above ?
------------------------------------------------------------

Best regards,
Eric



Wed, 12 Nov 2003 10:53:27 GMT  
 standard input and output question

Quote:

> Hello,

> I am a dummy in ShellScript.

> How to send the INPUT parameter to a program when it ask for input ? for
> example, just like "ftp", when I type "ftp localhost", it will ask for
> username and password. How to send the username and password to that ?

For some programs,

progname < file_of_input_commands

will work.

Not for ftp and such. You need to learn to sue expect. there are quite a
lot of good tutorials on it on the web.

This has nothing to do with awk, though.

-ed

--

/d{def}def/f{/Times-Roman findfont s scalefont setfont}d/s{10}d/r{roll}d f 5 -1
r 230 350 moveto 0 1 179{2 1 r dup show 2 1 r 88 rotate 4 mul 0 rmoveto}for/s 15
d f pop 240 420 moveto 0 1 3 {4 2 1 r sub -1 r show}for showpage



Thu, 13 Nov 2003 08:25:13 GMT  
 standard input and output question

Quote:


>> Hello,
>> I am a dummy in ShellScript.
>> How to send the INPUT parameter to a program when it ask for input ? for
>> example, just like "ftp", when I type "ftp localhost", it will ask for
>> username and password. How to send the username and password to that ?

[ .... ]

Quote:
> Not for ftp and such. You need to learn to sue expect.....

Hey, just leave expect out of this.  What has expect ever done to you? :-)

Quote:
> This has nothing to do with awk, though.

No.

--
Alan Mackenzie (Munich, Germany)

(like "aa"), remove one of them (leaving, say, "a").



Thu, 13 Nov 2003 21:37:06 GMT  
 standard input and output question

Quote:
>> Not for ftp and such. You need to learn to sue expect.....

> Hey, just leave expect out of this.  What has expect ever done to you?
> :-)

I was using expect when my moniter dropped off the table and broke my
foot. Clearly you can see where the blame lies.

-Ed

--

/d{def}def/f{/Times-Roman findfont s scalefont setfont}d/s{10}d/r{roll}d f 5 -1
r 230 350 moveto 0 1 179{2 1 r dup show 2 1 r 88 rotate 4 mul 0 rmoveto}for/s 15
d f pop 240 420 moveto 0 1 3 {4 2 1 r sub -1 r show}for showpage



Sat, 15 Nov 2003 18:33:47 GMT  
 standard input and output question
For ftp you can setup `.netrc' file.
With username and password listed for this machine. And then
you can feed it with get/put/cd/etc. on stdin.


Quote:
> Hello,

> I am a dummy in ShellScript.

> How to send the INPUT parameter to a program when it ask for input ?
> for example, just like "ftp", when I type "ftp localhost", it will ask for
> username and password.
> How to send the username and password to that ?

> -------------------------------------------------------------------
> #!/bin/sh

> HOST="192.168.0.1"
> USER="eric"
> PASS="eric"

> #....( I don't know how to implement it for connectint to a FTP server)
> #Would you please to show me how to automatic connect to a FTP server with
a
> script by providing HOSTNAME, # USERNAME and PASSWORD as above ?
> ------------------------------------------------------------

> Best regards,
> Eric



Wed, 19 Nov 2003 05:18:26 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. VSE - Redirect Standard input/output

2. standard input and output in VHDL

3. standard output and input (help)

4. which units are connected to standard input and output

5. Create polymorhpic output for I32 input (select output type)

6. Ruby vs. Tcl input/output question

7. asm input / output question

8. Question: Windows keyboard input/output buffer handler

9. asm input / output question

10. Ada95 input output - simple question from novice

11. input/output file question

12. Output/Input formatting question (FORTRAN 70)

 

 
Powered by phpBB® Forum Software