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




Thread: loop problem
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 05-25-2007
maskot maskot is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 20
loop problem

Got a problem with a loop that do this for each line:
a=$(( cost + $( awk ' { print $2 } ' file) ))
awk ' $2 ~ "^[0-9]" && $2 > 0 {$2='$a';print} ' file

#!/bin/sh
cost=30
for, until, while?
do
"db update OD_LINK_COST something"
done

For troubleshoot the file looks like this
55 10
56 10
57 20
58 10
and so on