Re: How to setup a simple shell script? "bad interpreter: No such file or directorybin/bash&quo

Re: How to setup a simple shell script? "bad interpreter: No such file or directorybin/bash&quo

am 28.12.2007 04:35:12 von Old Man

"Matthew Lincoln" wrote in message
news:475d485a$0$13120$9b4e6d93@newsspool2.arcor-online.net.. .
> 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?
>
> Matthew

I just copied a file from Windows to Linux, then ran it. The same
error was returned. I simply forgot to open the script with VI,
enter ":set ff=unix", then close it. Ran fine.

As an FYI, when I open the file with VI/VIM, it does not show the
carriage return. When searching, it won't find it, but they are there.
Just set file format to unix and it should work.

Old Man

Re: How to setup a simple shell script? "bad interpreter: No such file or directorybin/bash&quo

am 28.12.2007 09:09:47 von Joachim Schmitz

"Old Man" schrieb im Newsbeitrag
news:Q9_cj.36064$gF4.519@trnddc02...
>
> "Matthew Lincoln" wrote in message
> news:475d485a$0$13120$9b4e6d93@newsspool2.arcor-online.net.. .
>> 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?
>>
>> Matthew
>
> I just copied a file from Windows to Linux, then ran it. The same
> error was returned. I simply forgot to open the script with VI,
> enter ":set ff=unix", then close it. Ran fine.
>
> As an FYI, when I open the file with VI/VIM, it does not show the
> carriage return. When searching, it won't find it, but they are there.
standard vi shows them as ^M, vim does not (nor does the Linux vi, which
actually is vim), but it shows a "[dos]" in the bottom left corner (the
status line) directly after opening the file.
Also a ":set ff" shows

Bye, Jojo