#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2007
    Posts
    2
    Rep Power
    0

    Thumbs down .sh file is not running


    Hello Friends

    I am new to UNIX and shell Scripting.

    I have created a script file and saved it with .sh extention in a directory.

    but when i want to run it using ./abc.sh
    it is not running.

    it is giving the error
    ./abc.sh: not found.

    Please Help me
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2007
    Posts
    47
    Rep Power
    23
    try to run with full path
    Code:
    /full_path/abc.sh
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2007
    Posts
    2
    Rep Power
    0
    Originally Posted by anbu23
    try to run with full path
    Code:
    /full_path/abc.sh
    Hello Friend
    still it is giving the same error.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2007
    Posts
    47
    Rep Power
    23
    If you have space in the directory name then try like this
    Code:
    /dir1/"dir  2"/abc.sh
    or
    Code:
    PATH=$PATH":."
    Then execute with just name of the script
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2006
    Posts
    2,632
    Rep Power
    1811
    Belt and braces ... is it actually executable?:
    Code:
    ls -l abc.sh
    The moon on the one hand, the dawn on the other:
    The moon is my sister, the dawn is my brother.
    The moon on my left and the dawn on my right.
    My brother, good morning: my sister, good night.
    -- Hilaire Belloc
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jul 2004
    Location
    Middle Europa
    Posts
    1,198
    Rep Power
    17
    unix does not need extensions (like .sh) that is just for your info.

    ./abc and ./abc.sh will both run if they have the perms.

    ./abc.sh: not found
    MEANS NOT ./abc.sh IS NOT FOUND
    but the interpreter you are calling in ./abc.sh IS NOT FOUND !

    clear ?
    if not, post the first 3 lines of abc.sh and the output of
    echo $SHELL
    working on Solaris[5-9], preferred languages french and C.

IMN logo majestic logo threadwatch logo seochat tools logo