$pg ifelif1

#!/bin/bash

if [ -z "$1" ] || [ "$1" = "" ]

then

    echo "You are not enter name!"

elif

[ -w "$1" ]

then

   echo "You can write!"

elif

[ -x "$1" ]

then

   echo "You can execute!"

else

   echo "You cna not write or execute!"

fi

-------------------------------------------------------------------------

我的电脑里有个input 文件执行后的结果:

[root@localhost wang]# ./ifelif1 input

You can write!

我把input的文件改为:400后,还是这样的结果:

[root@localhost wang]# chmod 400 input

[root@localhost wang]# ./ifelif1 input

You can write!

-------------------------------------------------------------

跪求高人指点,谢谢