Author: glen Date: Fri Nov 9 02:35:40 2007 New Revision: 9030 Modified: rc-scripts/trunk/rc.d/init.d/functions Log: - add is_empty_file() function
Modified: rc-scripts/trunk/rc.d/init.d/functions ============================================================================== --- rc-scripts/trunk/rc.d/init.d/functions (original) +++ rc-scripts/trunk/rc.d/init.d/functions Fri Nov 9 02:35:40 2007 @@ -104,6 +104,13 @@ esac } +# checks if file is empty +# empty lines and lines beginning with hash are ignored +is_empty_file() { + [ -s "$1" ] || return 0 + egrep -vq '^(#| *$)' "$1" && return 1 || return 0 +} + # returns OK if $1 contains $2 strstr() { local a=$2 _______________________________________________ pld-cvs-commit mailing list pld-cvs-commit@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit