On Wed, 2003-06-18 at 12:52, Bryan Murdock wrote:
> I knew I was getting something not quite right in my explanation there. 
> Thanks for clearing that up Stuart.  
> 
> The lack of a sha-bang doesn't prevent it from being started as a child
> process, but would having the sha-bang cause it always execute as a
> child process, sourced or not?

The lack of sha-bang _does_ prevent it from being started as a child
process. It prevents it from being started as any type of process. With
out the sha-bang your would have to type
sh myfile.sh
or
cat myfile.sh | sh
making it input, not a process. (Actually, that's all the hash bang does
is tell the kernel to start sh, or some other program, then send the
file as input to the program.)

When you source the file, you are specifically telling it not to start a
new shell but execute it within the current shell. Taken as input, the #
marks a shell comment and the rest of the line is ignored. Now if you
_execute_ any shell scripts while sourcing, those of course will have
separate shells. So if a sourced file needs to include another file it
must also source that file.

Clear as mud?

> The book link you gave me, Stuart, sadly didn't work. :(

The Korn shell : user and programming manual
Olczak, Anatole

Pricey be available in the library.

> P.S.  For some reason now that I'm using HP's exchange server for email

File a bug report with HP, unless this is mimicking a broken Exchange
behavior.

-- 
Stuart Jansen <[EMAIL PROTECTED], AIM:StuartMJansen>

"What hole did you dig that up from?" 
   -- my roommate commenting on my taste in music

Attachment: signature.asc
Description: This is a digitally signed message part

____________________
BYU Unix Users Group 
http://uug.byu.edu/ 
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to