Why is my shell script not executing?
6,055
The error has nothing to do with gedit and/or nano. Your script call is a bit wrong. This error occurs, if you start sh
with an non-existing file in the current folder. Therefore start your script with a full path:
sh /path/to/your/script.sh
or change your current folder and start your script inside this folder:
cd /path/to/your
sh script.sh
Related videos on Youtube
Author by
Linuxuser001
Updated on September 18, 2022Comments
-
Linuxuser001 over 1 year
I executed it in terminal using:
sh script.sh
And I get this error:
sh: 0 can't open script.sh
-
AlexGreg over 8 years
ls -l
to where your script resides? -
steeldriver over 8 yearsFYI
sh
does not "execute the script in bash" - it executes it insh
, which by default isdash
on Ubuntu systems: see DashAsBinSh
-