cannot run script file
My OS is Debian Wheezy on a raspberry pi.
I am trying to run a script file which starts with the hashbang line #!/bin/sh and get the error message No such file/ folder. In debug mode (#!/bin/sh -x) i get the following message /bin/dash: 0:illegal option - I have tried everything I can think of with no success. Any help or suggestions gratefully received |
FYI - Your Profile Distribution: has a typo in it.
Recommend you post your script using the # menu item in the Go Advanced editing function. It should look like this... Code:
The code goes here. |
Probably /bin/sh is sim-linked to /bin/dash, or there is no sh shell and only dash shell is available. Dash is believed to be limited in functionality. So try /bin/bash hashbang and see what happens.
You can try this to find available shells in your system. Code:
$ cat /etc/shells |
The above cmd is a good idea; I also recommend
Code:
ls -l /bin/*sh |
cannot run script file
Thanks to all for replies but no help. I have tried all available shells but always get the same message "Bad interpreter no such file or folder"
Snowboy |
I see you have windows in your profile.
ms adds cr-lf to the end of each line. are you editing it in windows ? also, try running this: cat -A script.ksh |
Hi everyone.I have at last fixed my problem.The file is a shell file and all that I could find said that the hashbang line must be line 1.
I moved that line to the first line after the INFO block and hey presto it works. snowboy |
What 'INFO' block?
|
script info block
LSB compliant files start with an INFO block. the first line is ### BEGIN INIT INFO then follows several lines of information about the script each beginning with a # the last line is ###END INIT INFO. That is where I had to put the shebang line.
|
All times are GMT -5. The time now is 01:27 PM. |