#!/bin/sh -u # File-testing operations by the TEST command in an IF statement # Reference: Chapter 11 # For a larger list of file-testing operators used by TEST, see p.372 # -IAN! idallen@ncf.ca path=/etc/passwd if [ -f "$path" ] ; then echo "The path '$path' is a plain file" else echo "The path '$path' is missing or is not a file" fi if [ -r "$path" ] ; then echo "The path '$path' is readable" else echo "The path '$path' is missing or not readable" fi if [ -s "$path" ] ; then echo "The path '$path' has a size bigger than zero" else echo "The path '$path' is missing or empty (zero size)" fi