在 shell 中表示逻辑 or 可以使用 -o: #!/usr/bin/bashecho $0 $1 $2if [ -f $1 -o -f $1.html ]; then echo 'exist!'else echo 'does not exist!'fi 将脚本存为 hello $1 表示用户输入的第一个参数,如: $ hello world # world 为 $1 当 world 或 world.html 存在时,打印 exist!