Re: bash scripts: how to determine directory of 'source'd file
- From: Juergen Fiedler <juergen@xxxxxxxxxxxxxxxxx>
- Date: Tue, 31 Jan 2006 10:16:49 -0500
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
- Follow-Ups:
- References:
- Prev by Date: bash scripts: how to determine directory of 'source'd file
- Next by Date: Re: system hosed by udev in dist-upgrade
- Previous by thread: bash scripts: how to determine directory of 'source'd file
- Next by thread: Re: bash scripts: how to determine directory of 'source'd file
- Index(es):
Relevant Pages
|