Unix administration - Re: batch FTP program under CSH error ??

This is Interesting: Free IT Magazines  
Home > Archive > Unix administration > December 2005 > Re: batch FTP program under CSH error ??





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: batch FTP program under CSH error ??
Doug Freyburger

2005-12-06, 6: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.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com