On our school system, we're able to run script files without typing bash or csh or what have you without indicating what script type it is. On Ubuntu, however, I'm required to type bash script.bash for example. Is this always necessary in Ubuntu, or is it some setting I can change?
|
|
|||||||||||
|
Others already mentioned: it's important to have /bin/bash if you use bash features, also /bin/sh was symlinked to /bin/bash, but nowdays (as far as I noticed) it's symlinked to "dash" which won't provide bash compatibility, only the POSIX "sh". It's quite important, even quite expensive softwares at our firm have this issue: scripts contain #!/bin/sh as the first line but it depends on bash functionalities as well. |
|||||
|
|
Make sure the first line of the file reads:
If the shebang is You'll also need to make sure the script is executable, of course. |
|||
|
|