[Novalug] How can script know if it's been 'sourced' rather than 'called'?

Michael Stone mstone at mathom.us
Fri Apr 6 16:06:59 EDT 2007


On Fri, Apr 06, 2007 at 03:24:30PM -0400, Ben Creitz wrote:
>OK, I see what you mean about assumptions.  When we source a file, we
>don't get the advantage of the #!/bin/myshell, and that's where the
>problem begins, right?

Yes. The sourced file is executed within the user's current shell, 
whatever that happens to be.

Mike Stone


More information about the Novalug mailing list