我使用以下脚本来查看文件是否存在:
#!/bin/bash
FILE=$1
if [ -f $FILE ]; then
echo "File $FILE exists."
else
echo "File $FILE does not exist."
fi
Run Code Online (Sandbox Code Playgroud)
如果我只想检查文件是否不存在,使用的语法是什么?
#!/bin/bash
FILE=$1
if [ $FILE does not exist ]; then
echo "File $FILE does not exist."
fi
Run Code Online (Sandbox Code Playgroud) 在创建文件路径和URL时,我注意到路径以./or 开头很多次~/.
以./和开头的文件路径有什么区别~/?
他们每个人的意思是什么?