Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, I'm trying to execute a script, that it's been called from another one. But I always get the error -bash <file_name.sh>: No such file or directory, no matther if ...
  1. #1
    Just Joined!
    Join Date
    Aug 2010
    Posts
    4

    I can't execute a script called from another file

    Hi,
    I'm trying to execute a script, that it's been called from another one. But I always get the error -bash <file_name.sh>: No such file or directory, no matther if I am logged in with root or oracle user.
    The file exists, and it has all the permissions to execute. I don't know what's the problem.
    Here is my script called download_console.sh:

    echo .....................................
    echo "Downloading enterprise console`date`"
    echo .....................................
    echo "Where I am?"
    pwd
    echo "The file exists?"
    ls -l /u01/dba/scripts/directory.sh
    ./u01/dba/scripts/directory.sh
    echo .....................................
    echo "End of download `date`"
    echo .....................................

    And here are the permissions of both files:
    -rwxrwxrwx 1 oracle oinstall 28 Aug 16 09:58 directory.sh
    -rwxr-xr-x 1 oracle oinstall 440 Aug 16 10:08 download_console.sh

    The result of the script is:
    .....................................
    Downloading enterprise console Mon Aug 16 15:05:27 CST 2010
    .....................................
    Where I am?
    /u01/dba/scripts
    The file exists?
    -rwxrwxrwx 1 oracle oinstall 28 Aug 16 09:58 /u01/dba/scripts/directory.sh
    ./download_consola.sh: line 10: ./u01/dba/scripts/directory.sh: No such file or directory
    .....................................
    End of download Mon Aug 16 15:05:27 CST 2010
    .....................................


    PLEASE HELP ME!!!

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,695
    Google: how to call a script from within another script

    Code:
    . /path/to/script
    * Note the space

  3. #3
    Just Joined!
    Join Date
    Aug 2010
    Posts
    4
    Thank so much!!! You save my day. . Now it works fine!!

Posting Permissions

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