Shell 脚本:判断文件或目录是否存在
#!/bin/bash read -p 'Please enter a file or directory name: ' filename
if [ ! -e '$filename' ]; then echo 'File or directory does not exist' else echo 'File or directory exists' fi
exit 0
原文地址: https://www.cveoy.top/t/topic/ojet 著作权归作者所有。请勿转载和采集!