![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Stumped | JeffR | Shell Programming and Scripting | 3 | 05-30-2008 06:01 PM |
| RegEx question has me stumped | tolmark | UNIX for Dummies Questions & Answers | 7 | 08-18-2007 03:20 PM |
| httpd.conf - stumped | Cameron | IP Networking | 2 | 04-25-2002 02:31 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Piping the output to sort?
|
| Forum Sponsor | ||
|
|
|
|||
|
does anyone know how to use the system command in awk? Been trying to sort with the following:
Code:
END {
for ( i in x )
if ( i != "0-0" ) {
printf "%s",i | system("sort -nk 1") }
|
|
|||
|
Thanks ruben.
I am still having issues with sorting these arrays with awk. This is what I have now: Code:
END {
for ( i in x )
if ( i != "0-0" ) {
printf "%s\n",i | "sort -nk 1 > /tmp/a.out 2>&1"}
while ( (getline < "/tmp/a.out") > 0 )
sort[$1]
for ( s in sort )
printf "%s\n",s }
Any awkologist that can help would be very much appreciated. Thanks |