Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    1

    Unanswered: executing perl script from shell script

    I need to execute a perl script from a shell script. If the execution is success, then I need to ftp a file. Else I want the script to be forced to exit with a non-zero status string. My problem is not the executing of the perl script from shell script, but the things to be done after its execution (if-then-else). I have written the following code.

    #!/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

  2. #2
    Join Date
    Jan 2004
    Location
    Bordeaux, France
    Posts
    320
    What is your problem ? This script seems to be correct
    Jean-Pierre.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •