I seem to remember that if you create a shell script in a Windows editor
and attempt to execute it in Unix the extra line feeds that Windows
throws in wrecks the magic line at the top of the file. James should
edit that file in a Unix editor and rewrite the first line - that should
fix things. 'Course, if he gave the error message that was printed when
he ran the script it might help too!
Vincent Cunniffe wrote:
>>James.Chambers at irishlife.ie wrote:
>> > if I create a text file in notepad on windows, is it possible to make it
> > executable on linux, I tried chmod +x and changing the owner of the file. No
> > matter what I did it wouldn't execute for me.
> The output from a compiler would have this automatically, but you have to
> add your own when writing things such as text scriptfiles.
>> The following is a valid script :
>> echo "Hello world!"
>> The 'magic' is the first two characters, #!, followed by a valid interpreter
> which will be handed the file to execute. You can have anything here,
> including a unix shell, a PHP parser, a java engine, or whatever.
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!