Linux/CSHELL:
How can I get the path to a tcsh script that is being sourced?
This is not $PWD. Rather, the path to the script (file).
Versions/specifics:
% echo $SHELL $PLATFORM
/tool/pandora/bin/tcsh linux_3.10.0_64
ls -l /tool/pandora/bin/tcsh
lrwxrwxrwx 1 pandora pandora 33 Oct 20 2016 /tool/pandora/bin/tcsh -> ../.package/tcsh-6.19.00/bin/tcsh
There are lots of notes in here for this type of thing. But I didn't see one for linux c-shell.
Thanks in Advance !
Example:
I have a file /home/myid/my_cshell.csh...
set a = `readlink -f ${0}`
echo $a
echo ${0}
source /home/myid/my_cshell.csh
/tool/pandora/.package/tcsh-6.19.00/bin/tcsh
/tool/pandora/bin/tcsh
This is giving me the path to tcsh, not /home/myid/my_cshell.csh
The script above works fine if I tcsh it, but not source it. I need the path to the file being sourced.