Bash script #!/bin/sh or #/bin/sh
Hello,
This is my first time here, and I normally search the internet for most of my questions about bash scripts, this one looks a bit more serious. ----- Code:
#!/bin/sh will@arduino:~$ ./test -e \e[0;34mHello World!\e[0m ----- changing this 'Hello World!' script above by removing the '!' from #!/bin/sh ----- Code:
#/bin/sh will@arduino:~$ ./test Hello World! ----- the Hello World! above is in blue. It may not be as serious, but without the '!' the script echo commands work but is in one color when I am editing it with nano. With the '!' the echo commands fail, but it has the coloring while editing with nano. Thank you |
That'll be 2 different issues.
1. If a shell file starts with Code:
#!/dir/some_shell Code:
./file.sh If the 1st line does not start with '#!', but Code:
#/dir/some_shell IOW '#!' at the start of the 1st line is a special signal to the system to treat the remaining chars as the program to use; this also works for perl amongst others. 2. nano; I'm guessing there's a nano cfg somewhere that uses similar rules to try to understand/highlight the syntax of the file. Personally I use vim, which does syntax highlighting for file types it recognises. HTH |
Thank you for clarifying that for me
I did echo $SHELL and replaced, Code:
#!/bin/sh Code:
#!/bin/bash |
|
All times are GMT -5. The time now is 07:52 PM. |