![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| Passing shell variable to NAWK | wakhan | Shell Programming and Scripting | 1 | 04-23-2008 03:52 AM |
| passing variable to my script | aladdin | UNIX for Dummies Questions & Answers | 5 | 06-18-2007 10:34 AM |
| Passing PL/SQL variable value to Shell Varible | ganapati | Shell Programming and Scripting | 10 | 01-31-2007 02:17 AM |
| Passing a variable into an awk script | Khoomfire | UNIX for Advanced & Expert Users | 5 | 09-05-2006 09:44 AM |
| passing value to shell variable | trynew | Shell Programming and Scripting | 2 | 06-24-2002 03:13 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
passing awk variable to the shell script
hi;
i have a file containing lines like: 1|1069108123|96393669788|00963215755711|2|0|941||;serv:Pps6aSyria;first:0;bear i want to extract the second, third and fourth record of each line and store it in a file ";" seperated this is what i wrote while read line do A_party=`echo $line |awk -F["|"] '{print $3}'` B_party=`echo $line |awk -F["|"] '{print $4}'` time=`echo $line |awk -F["|"] '{print $2}'` echo $A_party";"$B_party";"$time >> $_outfile done < $_infile But the problem is that i am calling three times awk for each line, how can i pass awk variable to the script in order to call awk only one time. Thanks in advance. ![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|