![]() |
|
|
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 |
| Format output using awk in script. | bperl | Shell Programming and Scripting | 8 | 01-14-2008 01:09 AM |
| Q: Recording shell script screen output using "script" command ? | lalfonso.gomez | Shell Programming and Scripting | 4 | 01-18-2007 09:31 PM |
| log script input and output using tee ? | moseschrist | Shell Programming and Scripting | 0 | 11-12-2006 03:32 AM |
| File name of a script output | cheo_pr | Shell Programming and Scripting | 3 | 09-01-2005 05:40 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Please i need your help.
i made this script with awk, this scripts count and list a pattern for each directory in the output as shown. but not as desired. i want the output will be listed in a tabular way, using awk: cuenta_cdrs() { for dir in * do cd $dir for file in * do if [ -f $file ] then cat listacdrs|awk ' BEGIN {print "dia", "\t", "Cantidad"} $1 == prev {totaldia+=1} $1 != prev {print prev,totaldia;totaldia=1;prev=$1;filas=filas+1}' fi done cd .. done } OUTPUT dia Cantidad 01/09/2006 1275 02/08/2006 1285 03/08/2006 1310 04/08/2006 1300 05/08/2006 1415 dia Cantidad 01/09/2006 1275 02/08/2006 1285 03/08/2006 1310 04/08/2006 1300 05/08/2006 1415 06/08/2006 1265 dia Cantidad 01/09/2006 1275 02/08/2006 1285 But i want the output to be this way: OUTPUT DESIRED dia Cantidad dia cantidad 01/09/2006 1275 01/09/2006 1275 02/08/2006 1285 02/08/2006 1285 03/08/2006 1310 03/08/2006 1310 04/08/2006 1300 04/08/2006 1300 05/08/2006 1415 05/08/2006 1415 Thanks |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|