Linux.com

Any way to extract the script's directory

Posted by: Anonymous [ip: 216.27.162.2] on November 06, 2007 03:03 PM
Is there any way to extract the directory in which the shell script actually resides?

(As in, if I put a script in /usr/local/bin/script.sh and execute it from ~, is there a way to have the script know it is physically in /usr/local/bin?)

Thanks!

#

Return to Four ways to extract the current directory name