|
| Matthew Lincoln wrote:
> I wanted to setup a simple shell script "test3" with some commands inside.
>
> I started the script with
>
> #!/bin/bash
> ....
>
> When I call the script I got the error:
>
> : bad interpreter: No such file or directorybin/bash
>
> Hmm, why is there no such file ?
>
> If I type at the shell:
>
> echo $SHELL
>
> then I got the reply:
>
> /bin/bash
>
> Moreover /bin/bash exists!!
>
> So how do I setup a shell script otherwise?
>
> Am I forced to append a ".sh" extension?
no need for the .sh extension.
I can think of two issues causing this:
1) try delimiting your shebang with a space, so it will look like this:
#! /bin/bash
Not sure why, but this helps sometimes.
2) make sure the editor you use to write shell scripts is set to use
Unix end of line and not DOS/Windows. DOS/Windows uses two characters:
CR and LF ("carriage return", "line feed") to mark end of line in a text
file. Unix text files end with an LF ("line-feed") only. To remove the CR:
tr -d '\r' < dosfile > unixfile
--
artix
http://www.abstractart.ws _Abstract Art Directory_
|
|