emily
April 23, 2014, 10:52am
1
Dear all,
I have piece of command from tcsh, which I would like to be in my .bashrc file.
However, I am comletely blank about the tcsh commandline.
if (-e ~/forum/dir/code.sh) then
source ~/forum/dir/code.sh
endif
Any piece of suggestions how to convert it to sh way?
Thank you
emily
If I get its meaning:
[ -e ~/forum/dir/code.sh ] && . ~/forum/dir/code.sh
emily
April 23, 2014, 11:14am
3
Hello,
Thanks for reply.
A naive question what does '-e' implies?
I assumed it implies if that file ~/forum/dir/code.sh exist than source it. Am I right?
thanks again
emily
That is what it means in SH, yes. In CSH it must mean something similar from the context they're using it -- if the file exists, source it...
Right, -e
means the beast exists!
There is also -f
: exists as a file (not a directory).
Also see these Reference Cards , B-3 specifically.