Re: nano question

"Justin C. Walker" <[email protected]>
Newsgroups gmane.comp.macosx.admin
Message-ID <[email protected]>
On Mar 17, 2011, at 12:56 , János Löbb wrote:

> Folks,
> 
> I am Remote Desktop-ing to a machine and launch nano in a terminal to create some start ans stop files.  Here is one:
> 
> bml0066:tomcat administrator$ cat start1.sh
> #!/bin/sh  Startup script for the tomcat1 instance

Your problem is here.  The man page for 'bash' says

       If the program is a file beginning with #!, the remainder of the  first
       line  specifies an interpreter for the program.  The shell executes the

So the line should not be viewed as starting with "#" (i.e., a comment), but with "#!" (i.e., specifying an interpreter for the rest of the file).

The cure is to move the comment to a separate line.

HTH

Justin

--
Justin C. Walker
Director
Institute for the Enhancement of the Director's Income
--
Fame is fleeting, but obscurity
   just drags on and on.      F&E
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.