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 UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 05-14-2008
Smiling Dragon's Avatar
Smiling Dragon Smiling Dragon is offline
Disorganised User
 
Join Date: Nov 2007
Location: New Zealand
Posts: 711
I think you are being a bit vague here as to how much you want to add and to which values, but I'd guess at something like this:
Code:
#!/bin/sh
INC=0.01
while read line
do
  lineout=""
  for num in $line
  do
    num=expr $num + $INC
    if [ -z "$lineout" ]
    then
      lineout=$num
    else
      lineout="$lineout $num"
    fi
  done
  echo "$lineout"
done
(Untested)
Reply With Quote