Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
shell script for ftp
Name: Bob Date: October 21, 2002 at 17:11:46 Pacific OS: redhat80 CPU/Ram: 256
Comment:
How can I write a shell script which do the ftp to host without promt for user/password...
Name: David Perry Date: October 21, 2002 at 18:51:51 Pacific
Reply:
#! /bin/sh echo This will use a "here" document to embed ftp commands in this script # Begin of "here" document ftp <<** open anyserver.anywhere.net anonymous mymail@mailserver.net cd pub bin get anyfile.tar.gz bye ** # End of "here" document echo ftp transfer ended.
0
Response Number 2
Name: David Perry Date: October 21, 2002 at 19:02:17 Pacific
Reply:
Or this example from 'Ben' using parens to nest a subfunction.
Start: ( echo "user username password" echo "lcd /tmp" echo "Yet more ftp cmds" echo "Yet more ftp cmds" echo "Yet more ftp cmds" echo "bye" ) | ftp -vni hostname /tmp/logfile.$$ :end of script Hope this helps
0
Response Number 3
Name: chupacabra Date: October 22, 2002 at 14:10:42 Pacific
Reply:
The one script above doesn't work for me....the following one works...
#!/usr/bin/sh ftp -n << EOF verbose open yourhost user username password get /tmp/stuff close EOF
##chupacabra
0
Response Number 4
Name: Matt Date: November 7, 2002 at 03:12:32 Pacific
Reply:
Use wget! Wget is non-interactive utility for downloading...
Summary: Hi. I am a beginner on scripting. I will write a shell script for string encryption/decryption. the script will take 3 parameters. First one will be a flag telling whether to do encryption or decrypti...