How can I find the location of the tcsh shell script I'm executing?

Posted by julian-mann on Stack Overflow See other posts from Stack Overflow or by julian-mann
Published on 2010-04-01T20:04:09Z Indexed on 2010/04/01 20:33 UTC
Read the original article Hit count: 580

Filed under:
|
|
|

Say I put an executable tcsh file in /path/to/my_script.csh

and my current directory is anywhere, for example I'm in /path

So I type to/my_script.csh

I want to have a line in my_script.csh that will return "/path/to/my_script.csh" - like ruby's

__FILE__

© Stack Overflow or respective owner

Related posts about tcsh

Related posts about shell-scripting