Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

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
Source by askubuntu.com #
 
PREVIOUS NEXT
Tagged: #bash #check #file #readable
ADD COMMENT
Topic
Name
3+4 =