to check if file readable or not bash code example
Example: bash check if file is readable
FILE="/path/to/some/file"
if [[ -r $FILE && -w $FILE ]]; then
# do stuff
else
# file is either not readable or writable or both
fi
FILE="/path/to/some/file"
if [[ -r $FILE && -w $FILE ]]; then
# do stuff
else
# file is either not readable or writable or both
fi