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



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


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx



Relevant Pages

  • Re: bash scripts: how to determine directory of sourced file
    ... >> Presuming I have a file setEnvVars.sh that I wish to source, ... what I am trying to do in the script is get it to work out the directory ... thanks, michael ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
    (Debian-User)
  • Re: How do I automate this?
    ... > pause for about 3 seconds and then run ... putting sleep in that script. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ... Prev by Date: ...
    (Debian-User)
  • Re: apt-get upgrade fails due to kernel-image problem
    ... Try this script: ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ... Trouble? ... Prev by Date: ...
    (Debian-User)
  • RE: forwarding logs
    ... Same with another script. ... >> You should not need to cange anything in the log script itself. ... >> Reuben D. Budiardja ...
    (RedHat)
  • RE: forwarding logs
    ... Same with another script. ... >> You should not need to cange anything in the log script itself. ... >> Reuben D. Budiardja ...
    (RedHat)