Re: bash scripts: how to determine directory of 'source'd file



On Tue, Jan 31, 2006 at 02:26:27PM +0000, michael wrote:
> Presuming I have a file setEnvVars.sh that I wish to source,
> . path/setEnvVars.sh
> How do I, within the script, determine the actual directory within which
> the setEnvVars.sh file sits? The sourcing seems to disallow me access to
> $0 etc
>
> thanks, M

If I understand your question correctly, the '$_' variable should do
the trick.

--j

Attachment:signature.asc
Description: Digital signature



Relevant Pages