ftp in a shell script
Posted: 2007/05/12 14:08:04
I recently downloaded and installed centos 4.4 and it looks pretty nice so far. I guess you could say I'm some what of a linux noob. Anyway, here is my question (and any help would be greatly appreciated!):
I'm trying to get a shell script to ftp a certain file. I'm using the below syntax in the script:
#!/bin/sh
HOST='www.my_website_address.com'
USER='username'
PASSWD='password'
FILE='file.txt'
ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
put $FILE
quit
END_SCRIPT
exit 0
The trouble is the script doesn't work. If I try to run the script with ./ I immediately get the error:
: bad interpreter : no such file or directory
If I try to run the script with sh it attempts to run but kicks back more errors:
: command not found
: numeric argument required
According to what I've read this should be mostly simple, but it is frustrating...so, again, any help would be great!
Thanks!!
I'm trying to get a shell script to ftp a certain file. I'm using the below syntax in the script:
#!/bin/sh
HOST='www.my_website_address.com'
USER='username'
PASSWD='password'
FILE='file.txt'
ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
put $FILE
quit
END_SCRIPT
exit 0
The trouble is the script doesn't work. If I try to run the script with ./ I immediately get the error:
: bad interpreter : no such file or directory
If I try to run the script with sh it attempts to run but kicks back more errors:
: command not found
: numeric argument required
According to what I've read this should be mostly simple, but it is frustrating...so, again, any help would be great!
Thanks!!