如何判斷Bash中是否不存在常規(guī)文件?我使用了以下腳本來查看文件是否存在:#!/bin/bashFILE=$1
if [ -f $FILE ]; then
echo "File $FILE exists."else
echo "File $FILE does not exist."fi如果我只想檢查文件是否正確,那么正確的語法是什么?不存在?#!/bin/bashFILE=$1
if [ $FILE does not exist ]; then
echo "File $FILE does not exist."fi
添加回答
舉報
0/150
提交
取消