至少在Linux系统上是-h(bash是我的shell):
lrwxrwxrwx 1 mule mule 37 Feb 27 09:43 mule.log -> /home/mule/runtime/mule/logs/mule.log
[mule@emdlcis01 ~]$ if [[ -h mule.log ]]; then echo "mule.log is a symlink that exists" ; fi
mule.log is a symlink that exists
Run Code Online (Sandbox Code Playgroud)
检查man test您可以在给定环境中使用的文件和字符串上可用的运算符.