I have a secinario like , want to cat a file until the 123.txt gets empty ....for that i made below syntax, but looks not correct
HTML Code:
cat 123.txt
ram
suresh
John
PHP Code:
for chat in $(cat /tmp/t123.txt| head -1)
do
call=`grep -i incoming /home/$chat | wc -l `
if [ -n "$call" ]
then
echo " got incoming call from $chat "
else
echo "no incoming calls from $chat "
CHK=$(cat /tmp/t123.txt )
printf "1d\nw\nq\n" | ed -s $CHK
if [ $CHK -ge 1 ]
then
chat ++
else
exit 0
fi
done
My required o/p would be
HTML Code:
got incoming call from ram
got incoming calls from suresh
got incoming calls from John
Note: new to shell scripting , trying afte longtime
... so appericiate your help here