Name: Anonymous 2010-11-03 22:18
How can I change my code to be able to compare the size of two files.
if [ -f $1 ] && [ -f $2 ] && [ ! $1 -ef $2 ]; then
size1=$(du $1)
size2=$(du $2)
if [ $1 -gt $2 ]; then
echo "$1 is bigger"
else
echo "$1 is smaller"
fi
fi
if [ -f $1 ] && [ -f $2 ] && [ ! $1 -ef $2 ]; then
size1=$(du $1)
size2=$(du $2)
if [ $1 -gt $2 ]; then
echo "$1 is bigger"
else
echo "$1 is smaller"
fi
fi