then
echo "Usage: examl filename"
else
INPUT="a"
echo "Input text:"
while [ "$INPUT" != "" ]
do
read INPUT
echo $INPUT >> $1
done
fi
#process3
clear
echo "Input filename"
read filename
ls -l $filename
echo "a"
s=$(ls -l $filename)
SIZE=`ls -l $filename | cut -d " " -f 5`
echo $s
echo "the file $filename size :$SIZE"
currentsize=`echo $s | cut -d " " -f 5`
nochange=0
change=0
echo "he"
while [ $change -lt 2 -a $nochange -lt 10 ]
do
echo "Oringinal size is : $SIZE"
echo "current size : $currentsize"
if [ $SIZE -eq $currentsize ]
then
echo "File $filename size have not been changed"
nochange=`expr $nochange + 1`
echo "nochange times :$nochange "
else
echo "File $filename size has been changed"
change=`expr $change + 1`
echo "change times :$change"
SIZE=$currentsize
fi
s=$(ls -l $filename)
currentsize=`echo $s | cut -d " " -f 5`
sleep 5
done
if [ $change -eq 2 ]
then
clear
echo "change times:2 times"
else
clear
echo "not change"
fi