Invalid option when running bash script on Debian 7
When I ran
root@Nano:/etc/init.d# ./utserver
which is this script http://pastebin.com/c7gxFdci it gives me this output
": invalid option"
no matter how the arguments are executed.
source to share
Your file has DOS line endings \r\n
. Here's the relevant section from the bash wiki tag :
-
Make sure your script or data has DOS style trailing characters
-
Use
cat -v yourfile
orecho "$yourvariable" | cat -v
.DOS carriage returns will appear as
^M
after each line.If you find them, remove them using
dos2unix
(akafromdos
) ortr -d '\r'
-
source to share