PDA

View Full Version : [all variants] Problems running shell script



Sunfist
June 8th, 2008, 06:53 AM
When I try to run a shell script I get an error saying command not found, or something like that. If a script wont run, how do you go about finding out why it wont.

easybake
June 8th, 2008, 06:55 AM
It could be many things. If you post it, maybe someone might find the problem.

stchman
June 8th, 2008, 06:56 AM
When I try to run a shell script I get an error saying command not found, or something like that. If a script wont run, how do you go about finding out why it wont.

Post the shell script.

Baelus
June 8th, 2008, 07:03 AM
Are you having trouble actually running the script? I can't quite tell from your post. If that's the case then try this:

Make sure your script is executable.

Change to its directory and type:


chmod +x my_script.sh

Then run it with:


./my_script.sh

You need the full path to the script, or ./ if it's in the current directory, because the script isn't in your $PATH, so bash doesn't know about it.

- B

Barriehie
June 8th, 2008, 08:06 AM
This thread address' the same issue and offers solutions.

http://ubuntuforums.org/showthread.php?t=815115

Barrie