【发布时间】:2023-03-27 01:17:02
【问题描述】:
我正在编写一个脚本来检测一个文件是否是另一个文件的别名,如下所示,但似乎别名与符号链接的概念不同。
我怎样才能让它工作?
filePath=./aliasfile
echo $filePath
if [ -e "$filePath" ]; then
if [ ! -L "$filePath" ]
then
echo "$filePath is not alias"
else
echo "$filePath is alias"
fi
else
echo "=> $filePath doesn't exist"
fi
【问题讨论】:
-
en.wikipedia.org/wiki/Alias_(Mac_OS) 有别名文件格式的描述。或许
file能认出来?