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
- Re: bash scripts: how to determine directory of sourced file
... michael wrote: ... How do I, within the script, determine the actual
directory within which ... The sourcing seems to disallow me access to ...
(Debian-User) - Re: a variable CD in a CSH script
... and make sure the script doesn't have execute permission (so you don't ... >
I tried sourcing it, and running it normally (which obviously wouldn't ... > my alias
is 'alias utgo "source utgo.scpt"' ... and do not have the option to upgrade to tcsh. ...
(comp.unix.shell) - Re: Seamonkey -- has anybody successfully installed it?
... I'm not sure if sourcing is the best idea in this case, ... with a bunch of
settings in your shell you realy don't want to have. ... you may be using a different shell
from the one the script ... (Ubuntu) - Re: How to export environment variable to parent?
... sourcing a script and running it. ... Autodumbdacticism. ...
Charlie Zender, my_surname@uci.edu, 824-2987, Department of ... (comp.unix.shell) - Re: sourcing a file question
... Thanks for all the responses. ... sourcing, as that is why I asked the
question. ... the argument used when the initial script was run. ... >>I'm
adding more functionality toa script file on Solaris this is ... (comp.unix.shell)