Re: batch FTP program under CSH error ??
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix administration > Re: batch FTP program under CSH error ??




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

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


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
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 ]



    Sponsored Links  




 





   All times are GMT. The time now is 07:29 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register