Unix not checking file permissions properly

31 views Asked by At

I executed the following commands in unix machine:

blr59-adm1:~ # ls -l / | grep back
d-w--w--w-   2 root root  4096 Jun  9 13:31 backupmnt
blr59-adm1:~ # [ -x /backupmnt ]
blr59-adm1:~ # echo $?
0
blr59-adm1:~ #

I am not able to get why I am getting the output of echo $? as 0 even if my directory is not having execute permissions.

My shell script is failing because of this behavior.

Please correct me if I am doing wrong.

0

There are 0 answers