The UNIX and Linux Forums  

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 -->
  #4 (permalink)  
Old 06-28-2006
grial's Avatar
grial grial is offline Forum Advisor  
El UNIX es como un toro
  
 

Join Date: Jun 2006
Location: Madrid (Spain)
Posts: 531
You could store it in a file:

Code:
# Initial value used to compare.
val=$(cat /path/to/file.txt)

/path/to/file.txt
should contain only one line with the number and must exist in the first run in this case.
Finally:

Code:
echo "-----------"
echo "###########"
echo "-----------"
echo "val=$val"
echo $val > /path/to/file

So that you update the file with the new value.