dailyworkreportonMay11,

编程

Bash: If/Else statement in one line

lwk@qwfys:~$ ll ~/Downloads/hosts

-rw-r--r-- 1 lwk lwk 1110 May 9 13:04 /home/lwk/Downloads/hosts

lwk@qwfys:~$

lwk@qwfys:~$ if [ -f "~/Downloads/hosts" ];then echo "ok";fi

lwk@qwfys:~$ if [ -f "Downloads/hosts" ];then echo "ok";fi

ok

lwk@qwfys:~$ if [ -f "./Downloads/hosts" ];then echo "ok";fi

ok

lwk@qwfys:~$ if [ -f "/home/lwk/Downloads/hosts" ];then echo "ok";fi

ok

lwk@qwfys:~$

以上是 dailyworkreportonMay11, 的全部内容, 来源链接: utcz.com/z/516315.html

回到顶部