1. 判断字符串"a.txt"等于变量filename 且 当前目录下不存在文件b.txt
#!/bin/bash filename="a.txt" if [ "a.txt" = $filename -a ! -e "b.txt" ]; then echo "yes" else echo "no" fi
1. 判断字符串"a.txt"等于变量filename 且 当前目录下不存在文件b.txt
#!/bin/bash filename="a.txt" if [ "a.txt" = $filename -a ! -e "b.txt" ]; then echo "yes" else echo "no" fi