1
在shell脚本中,可以使用什么命令来检查目录是否存在?如何在shell脚本中检查目录是否存在?
在shell脚本中,可以使用什么命令来检查目录是否存在?如何在shell脚本中检查目录是否存在?
if [ -d "/path/to/dir" ]
then
echo "Directory /path/to/dir exists."
else
echo "Error: Directory /path/to/dir does not exists."
fi
亲爱的@ayyappa,当您键入您的标题时,请看看建议的旧帖子;-) – Alfe