Quote:
Originally Posted by homey
Something like this...
Code:
#!/bin/bash
# Example: ./test file.txt
fsize=`stat -c %s $1`
if [ $fsize -lt 1 ] ; then
echo $1 is empty
else
echo $1 is not empty
fi
|
The new way of command-substitution and recommended is:
fsize = $(stat -c %s $1)
The result of both is the same. Not an advise only how i make it cos the backtick could be overseen in an hot programming session.
Happy new year.