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 -->
  #1 (permalink)  
Old 04-28-2008
mail2sant mail2sant is offline
Registered User
  
 

Join Date: Apr 2008
Location: bangalore
Posts: 71
how can i put the condition in for loop for the below.

i have the equation like below

07:35:07 ( AB : 2319f.ab * 22) + ( AB : 2320f.ab * 22.03 ) + ( AB :2321f.ab * 22.07 ) ...... N

i want put ":" as a delimiter and break the equation like below


2319f.ab * 22
2320f.ab *22.03
2321f.ab * 22.07
.
.
N

i know the number of coulmn for Eg 12 then i can user
for (( i=5;i<12;i++ ))

do

cat $1 | cut -d ":" -f"$i" >> a1
done


but for N number of .. how can i cut for the above ?