Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'How a shell script can find where it is located' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
How a shell script can find where it is located
Authored by: al451 on Feb 04, '04 03:37:33PM
The output of dirname $0 will tell you the directory in which the shell script is located. If your shell script wants to cd to the directory that contains the script itself, it should say
        cd `dirname $0`


[ Reply to This | # ]