Sponsored Content
Full Discussion: How to use for and if?
Top Forums Shell Programming and Scripting How to use for and if? Post 302998734 by natraj005 on Tuesday 6th of June 2017 02:43:27 PM
Old 06-06-2017
PHP Code:
for chat in $(cat /tmp/123.txthead -1)  # cutting the 1st line of the file which should be ram in my case
do 
call=`grep -i incoming /home/$chat | wc -l # search for incoming in /home/ram file and taking a count of it 
if [ -"$call
then  
echo " got incoming call from $chat " 
else  
echo 
"no incoming calls from $chat " 
CHK=$(cat /tmp/123.txt 
printf "1d\nw\nq\n" ed -s $CHK # removing teh first line of my file so that ram will get remove and suresh will come at the top
                  
if [ $CHK -ge 1 ]  # will check wther 123.txt is ge to 1 value
            
then 
            chat 
++  # then i have to perform the same for action until the file gets empty
            
else  
                exit 

               fi  

done 
 
All times are GMT -4. The time now is 03:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy