我剛接觸linux正學到shell編程if命令(以前沒接觸過編程),書上有個查看文件屬性的代碼我不是很明白特來請教 原文如下 #!/bin/bash #4.10.sh if test -z $1 then echo 'please input a file name' else if test -w $1 then echo "writeable" else echo "unwriteable" fi if test -x $1 then echo "excuteable" else echo "unexcuteable" fi fi 上面的意思不是test命令測試沒有輸入文件名時的時候輸出please input a file name 那下面不應該是測試文件不可寫時輸出writeable 我的理解上是不是錯了,在哪裡? 體諒一下自學的痛苦,麻煩各位。