![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| assigning nawk output to shell variable | user_prady | Shell Programming and Scripting | 6 | 11-29-2007 04:01 AM |
| How to make nawk to set a shell variable | rakeshou | Shell Programming and Scripting | 1 | 10-18-2007 02:33 AM |
| Passing a for loop variable into nawk | Ant1815 | UNIX for Dummies Questions & Answers | 3 | 05-01-2007 09:56 AM |
| Passing PL/SQL variable value to Shell Varible | ganapati | Shell Programming and Scripting | 10 | 01-31-2007 02:17 AM |
| passing value to shell variable | trynew | Shell Programming and Scripting | 2 | 06-24-2002 02:13 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Passing shell variable to NAWK
I am trying to make a simple script in which i take input from shell and then forward the value to
nawk (BEGIN). but when i run below mention script so it give no output. Code:
echo "Enter TRUNK GROUP:"
read TGR
cat /omp-data/logs/5etr/080422.APX | nawk -F"|" -v P=$TGR '
BEGIN {
TG=P;
printf ("DATE IN ST EN TGN ISEIZE ISATMP IANS OATMPT OVFL OSEIZE OSATMP OANS TOTUSG OOSMTCE OOS DBLSZR NTWCONG\n");
}
But when i run below code , so its work fine. Code:
#echo "Enter TRUNK GROUP:"
#read TGR
#cat /omp-data/logs/5etr/080422.APX | nawk -F"|" -v P=$TGR '
cat /omp-data/logs/5etr/080422.APX | nawk'
BEGIN {
TG=700;
printf ("DATE IN ST EN TGN ISEIZE ISATMP IANS OATMPT OVFL OSEIZE OSATMP OANS TOTUSG OOSMTCE OOS DBLSZR NTWCONG\n");
}
Can someone help me, to run the above code. Plz Help Regards |
|
||||
|
Double post questions is not allowed, please read the:
Simple rules of the UNIX.COM forums: This is a similar question of your previous thread, if you have more questions about your problem, continue here: NEW: need help with nawk using -v vars Thread closed. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|