if [[ -r $FILE ]]; then echo "File $FILE is readable by me" fiTo check if its world readable, use `stat` and some builtin bitwise ops.
#!/bin/sh FILE=/tmp/myfile.txt PERMS=$(stat -c '0%#a' $FILE) # $PERMS will be a 4 digit octal number WORLD_READABLE=$(($PERMS & 0007)) if [[ $WORLD_READABLE != 0 ]]; then echo "$FILE is world readable" else echo "$FILE is not world readable" fi