The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 06-06-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
Or maybe more like

Code:
set -- `ls -l "$file"`
size=$5
while true; do
  sleep 60
  set -- `ls -l "$file"`
  case $5 in $size) break;; esac
  size=$5
done
This will loop until the size of the file stays the same for 60 seconds. (You will need to set the variable file to the name of the file you want to monitor, of course.)