in reply to Re: Re: Re: Re: Re: calling perl script from shell script
in thread calling perl script from shell script

I have already tried that bit of code. My code is as follows.
#!/usr/bin/sh cd dir_where_perl_pgm_exists perl my_perl_pgm.pl ret=$? if [ $ret -eq 0 ] then echo "Success" echo "FTP the report now" ftp -n << EOF open ftp_server user user_name password put some_file ls -l bye EOF else echo "Failure" echo "Exit the pgm" return $ret fi
When I execute this code, it gives me error:
syntax error at line 22: `end of file' unexpected

Replies are listed 'Best First'.
Re(+): calling perl script from shell script
by pelagic (Priest) on Mar 29, 2004 at 09:16 UTC
    ... your EOF has to be alone and at the beginning of the line:
    EOF

    and not
    EOF

    pelagic

    -------------------------------------
    I can resist anything but temptation.
      I have now separated the ftp part in a different shell script. And I call this script from the main script if the status of execution of perl script is success. Thanks a lot anyway!!!