Sponsored Content
Full Discussion: use while after if
Top Forums Shell Programming and Scripting use while after if Post 302300138 by jim mcnamara on Monday 23rd of March 2009 10:11:31 AM
Old 03-23-2009
bash:
Code:
file=/tmp/test

ok=0
cmp /tmp/1 /tmp/2 &> /dev/null  && ok=1
if [[ $ok -eq 1 ]] 
then 
   echo "fail check ok"

   while [ ! -s $file ]; do
     echo "$file is empty"
     wget http://link -O /tmp/test
     sleep 3
   done
   cat /tmp/test 

else 
   echo "fail check fail"
    # do some action
fi

 
All times are GMT -4. The time now is 06:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy