![]() |
|
|
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 the values to the secondary script when it invoked by primary script | venu_eie | UNIX for Advanced & Expert Users | 2 | 07-03-2008 08:10 AM |
| Passing the values to the secondary script when it invoked by primary script | venu_eie | Shell Programming and Scripting | 1 | 07-03-2008 07:16 AM |
| create a shell script that calls another script and and an awk script | magikminox | Shell Programming and Scripting | 0 | 06-26-2008 03:50 AM |
| help me in sending parameters from sqlplus script to unix shell script | Hara | Shell Programming and Scripting | 2 | 01-29-2008 03:31 PM |
| Shell Script: want to insert values in database when update script runs | ring | Shell Programming and Scripting | 1 | 10-25-2007 04:06 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
AWK script
I have written an awk script. If i run it from command prompt with awk -f then it working fine. but when run the same statements in a script and named file as a1.awk and tried to run it awk -f a1.awk temp.txt > temp2.txt I doesn't work.
The script is like this awk -F'|' ' BEGIN{ } { if($4=="1"){ print "*********" a[$3] if( a[$3] < $6 ){ a[$3]=$7; b[$3]=$2; } else if ( a[$3] == $7 ){ if( $9 == 1 ){ b[$3]=$2; } } } next; } END { for ( x in b ) { print x "|" b[x] } } ' temp1.txt> /var/tmp/temp2.txt The above things works fine but when I put same thing in a script like a1.awk and run the script awk -f a1.awk temp1.txt > temp2.txt No output is written to output file. Please help me. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|