Monday, September 3, 2012

how we can check file is empty in linux shell script

#! /bin/ksh
FILE='/etc/passwd'
if [[ -s $FILE ]] ; then
echo "$FILE has data."
else
echo "$FILE is empty."
fi ;

No comments:

Post a Comment