Title: Determine if a file is readable by current Bourne shell script user Post by: Mark David on March 16, 2007, 01:35:19 PM Determine if a file is readable by current Bourne shell script user
A well constructed shell script, like any good program, should handle error conditions gracefully. Checking if a file is readable before attempting to read it allows a script to branch instead of abort or display an error message. Code: if [ -r testfile ] |