Re: Any awk gurus on the list?

2010-08-23 Thread Paul Schmehl
--On Friday, August 20, 2010 17:24:55 -0700 Randal L. Schwartz mer...@stonehenge.com wrote: Paul == Paul Schmehl pschmehl_li...@tx.rr.com writes: Paul Yes, I know I could do this easily in Perl. I'm doing this to try Paul and improve my understanding of awk. To what end? Every modern

Re: Any awk gurus on the list?

2010-08-22 Thread Wayne Sierke
On Fri, 2010-08-20 at 12:12 -0500, Paul Schmehl wrote: I'm trying to figure out how to use awk to parse values from a string of unknown length and unknown fields using awk, from within a shell script, and write those values to a file in a certain order. Here's a typical string that I want

Any awk gurus on the list?

2010-08-20 Thread Paul Schmehl
I'm trying to figure out how to use awk to parse values from a string of unknown length and unknown fields using awk, from within a shell script, and write those values to a file in a certain order. Here's a typical string that I want to parse: alert ip

Re: Any awk gurus on the list?

2010-08-20 Thread David Kelly
On Fri, Aug 20, 2010 at 12:12:20PM -0500, Paul Schmehl wrote: But when I add an FS to the script, I get odd results: # awk '!/#/ { FS=;; for (i=1; i=NF; i++) { if ( $i ~ /sid/) {mtcmsg[sid]=$i; print mtcmsg[sid]}}}' /usr/local/etc/snort/rules/mtc.rules.test sid:299913; sid:52123

Re: Any awk gurus on the list?

2010-08-20 Thread krad
On 20 August 2010 18:12, Paul Schmehl pschmehl_li...@tx.rr.com wrote: I'm trying to figure out how to use awk to parse values from a string of unknown length and unknown fields using awk, from within a shell script, and write those values to a file in a certain order. Here's a typical string

Re: Any awk gurus on the list?

2010-08-20 Thread Andres Perera
On Fri, Aug 20, 2010 at 12:42 PM, Paul Schmehl pschmehl_li...@tx.rr.com wrote: I'm trying to figure out how to use awk to parse values from a string of unknown length and unknown fields using awk, from within a shell script, and write those values to a file in a certain order. Here's a

Re: Any awk gurus on the list?

2010-08-20 Thread Randal L. Schwartz
Paul == Paul Schmehl pschmehl_li...@tx.rr.com writes: Paul Yes, I know I could do this easily in Perl. I'm doing this to try Paul and improve my understanding of awk. To what end? Every modern system that can run awk can also run Perl. Why not concentrate on Perl? -- Randal L. Schwartz -

Re: Any awk gurus on the list?

2010-08-20 Thread CyberLeo Kitsana
On 08/20/2010 07:24 PM, Randal L. Schwartz wrote: Every modern system that can run awk can also run Perl. Why not concentrate on Perl? Unless perl is not installed, and you want to use only base system components. I frequently do this on my minimalist flashcard installations. -- Fuzzy love,

Re: Any awk gurus on the list?

2010-08-20 Thread Chad Perrin
On Fri, Aug 20, 2010 at 05:24:55PM -0700, Randal L. Schwartz wrote: Paul == Paul Schmehl pschmehl_li...@tx.rr.com writes: Paul Yes, I know I could do this easily in Perl. I'm doing this to try Paul and improve my understanding of awk. To what end? Every modern system that can run awk