12-06-05 11:03 PM
aaa wrote:
>
> am writting a batch job under SUN Solaris 8. This batch job will "FTP" to
LINUX
> server. It must something not compatible to "csh". Can anyone give me a
hint?
>
> ============ batch program ccc.sh ====
>
> #!/bin/csh -v
>
> ftp -n server02 <<EOF
> user user1 passwd1
> pwd
> EOF
>
> ========= end batch program ====
>
> run program:
>
> %./ccc.sh
>
> ftp -n server02 << EOF
> EOF: << terminator not found
1) Rename it to ccc.csh. It is very corny to name a CSH script *.sh.
2) Add lines to the bottom. Sometimes here-files don't work right if
they terminate with an EOF instead of an EOL:
ftp -n server02 <<EOF
user user1 passwd1
pwd
EOF
exit 0
3) Fix your trailing whitespace. When I did the cut-n-paste to show
the added line I noticed that both lines with the string "EOF" in
them had trailing whitespace. Bzzzt! When doing a here-file do
NOT have any trailing white space. The shell does a string-match
and you don't want to mess with white space in string-match.
[ Post a follow-up to this message ]
|