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



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
while loop inside while loop panknil Shell Programming and Scripting 0 01-07-2008 12:49 PM
For loop xramm HP-UX 3 10-10-2007 02:20 PM
While Loop hemangjani Shell Programming and Scripting 2 11-02-2006 11:01 AM
for loop munnabhai1 Shell Programming and Scripting 3 04-06-2006 02:30 PM
how to get the similar function in while loop or for loop trynew Shell Programming and Scripting 3 06-17-2002 11:09 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #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 05:25 AM..
  #2 (permalink)  
Old 05-28-2007
lorcan lorcan is offline
Registered User
  
 

Join Date: May 2007
Posts: 219
Code:
cut -c1-3 file | read a
cut -c4-6 file | read b
Hope this solves the last part of the error
  #3 (permalink)  
Old 05-28-2007
maskot maskot is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 20
sorted

Got it sorted but thank you anyway!

Indeed your tip work.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:06 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0