hi all,
in ksh script how do i detect if a file is readable by others ??
thanks.
hi all,
in ksh script how do i detect if a file is readable by others ??
thanks.
ls -l file | awk '{if($1 ~ /.r..r..r../)print "File is readable by all";}'
[[ `stat --print=%A $1 | cut -c 8` = "r" ]] && echo "yes,readable for others"
if ls -ld somefile | grep -q ^-......r; then
echo world readable file
fi
[ "$(find "$filename" -perm -004)" ]
Cheers,
Alister
-perm -004
, no?
Woops! Indeed. Fixed. Thank you for catching that.