Re: help please

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 26 Aug 2004 17:52:56 -0700 (PDT), Mr. Oberoi <oberoi_1@xxxxxxxxx> wrote:
> can some one tell me what is wrong with the following
> filter for squidlog. I am getting the following error
> ===================================================
> [oberoi@localhost uni]$ ./squidlogconverter.sh access
> -n
> access file exists
> number each line sequentially, begning from 1 by
> default
> numbering file...
> awk: cmd. line:1: %9d.%03d %d %d.%d.%d.%d %s/%03d %d
> %s %s %s %s%s/%s %s /n { print $3 "," $4}
> awk: cmd. line:1: ^ syntax error
> awk: cmd. line:1: %9d.%03d %d %d.%d.%d.%d %s/%03d %d
> %s %s %s %s%s/%s %s /n { print $3 "," $4}
> awk: cmd. line:1:               ^ syntax error
> awk: cmd. line:1: %9d.%03d %d %d.%d.%d.%d %s/%03d %d
> %s %s %s %s%s/%s %s /n { print $3 "," $4}
> awk: cmd. line:1:                            ^ syntax
> error
> awk: cmd. line:1: %9d.%03d %d %d.%d.%d.%d %s/%03d %d
> %s %s %s %s%s/%s %s /n { print $3 "," $4}
> awk: cmd. line:1:
>            ^ syntax error
> 
> =====================================================
> is there any good help available on awk or patterns i
> have been searching lots but nothing useful to create
> this filter
> "%9d.%03d %6d %s %s/%03d %d %s %s %s %s%s/%s %s"
> thanks
> 
> =====
> deepak oberoi
> 
Hi, 
looks like you need to surround the {print $3 ","  $4} with ' (single
quotes), like this:
'{print $3, "," $4)'

as for help,
try "Sed and Awk" by O'Reilly Assoc., it's a very good book on the
subject, and at the mean time, try man awk :P
I know it's tedious read, but it's actually pretty comprehensive.

Yang



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux