The UNIX and Linux Forums  

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




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

Join Date: Jan 2007
Posts: 20
Loop

Hello there!

I dont seem to get a loop to work with this code, it simple refuse.
Any kind of help would be very much appreciated, got deadline today.

I need to cut out first 3 letters and letter 4-6 from each line and get it to become a variable.
So i can add the letters to the db.
So for each line in db add $a, $b.
I can write it like this, cut is not good but always something.
a= cut -c1-3 file
b =cut -c4-6 file
And then some kind of loop with this as command:
db2 "update PTS.OCC_LINK set OL_Link_COST = '$c' where OL_ID = $b"

Last edited by maskot; 05-28-2007 at 06:25 AM..