Unix Shell - Re: How to setup a simple shell script? "bad interpreter: No such file or directo

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > December 2007 > Re: How to setup a simple shell script? "bad interpreter: No such file or directo





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: How to setup a simple shell script? "bad interpreter: No such file or directo
Chris F.A. Johnson

2007-12-10, 7:20 pm

On 2007-12-10, 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 ?


Did you write the script on a Windows machine?
Is there a carriage return at the end of the line?

Do you get this output when you pipe the shebang through od:

$ head -n1 /path/to/script | od -c
0000000 # ! / b i n / b a s h \r \n \n
0000016


--
Chris F.A. Johnson, author <http://cfaj.freeshell.org/shell/>
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com