||
To check if a directory exists in a bash shell script you can use the following:
if [ -d "$DIRECTORY" ]; then # Control will enter here if $DIRECTORY exists fiOr to check if a directory doesn't exist:
if [ ! -d "$DIRECTORY" ]; then # Control will enter here if $DIRECTORY doesn't exist fiArchiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-12-22 14:49
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社