LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Shell script error. (https://www.linuxquestions.org/questions/linux-general-1/shell-script-error-9416/)

chuck77 11-29-2001 08:20 PM

Shell script error.
 
I downloaded a backup script: hostdump.sh
When i stored in one of the directory and run it.
it says "bash: command not found"

Let say, i store the script in /tmp

#cd /tmp
#./hostdump.sh
#"bash: ./hostdump.sh : no such file or directory"

or

#hostdump.sh
#"bash: hostdump.sh : command not found"


How do i solve it ? pls advise...
Thanks...

WindozBytes 11-29-2001 09:15 PM

This looks like the executable bit may not be set properly. Try

# chmod +x filename

chuck77 11-29-2001 10:18 PM

Hi.
 
I did the chmod operation before that.

#chmod 755 hostdump.sh


It really puzzle me..tat the script still don't work.

speck 11-29-2001 11:30 PM

I think I know what your problem is. Open the script in an editor and look at the first line. You should see something like "#! /usr/bin/sh". I'm guessing that the path in that line is incorrect.

Type "whereis bash" and you should see "bash: /bin/bash". Now edit the file and change the first line to "#! /bin/bash" (if your whereis command returned a different path than my example, just change it to your path.)

Speck


All times are GMT -5. The time now is 02:58 PM.