csh: How to check if symbolic link exists?

0

Symbolic link was create by command ln -s.
Tried if ( -e "$link" ) and if ( -f "$link" ). But it's not working.

Fisher

Posted 2018-05-16T11:44:16.873

Reputation: 289

Answers

1

If you are working in a tcsh (often installed as csh on Linux), then if ( -l "$link") should work.

The -l operator checks if a file is a symbolic link. I don't think there is an build-in equivalent in the plain csh.

Lars

Posted 2018-05-16T11:44:16.873

Reputation: 26