Re: Shell scripting question - incrementing

2008-02-19 Thread Dominic Fandrey
Paul Schmehl wrote: I could do this in perl easily, but I'm trying to force myself to learn shell scripting better. :-) ... Once this file is created (or ideally *while* it's being created!) I need to increment the sid numbers. The first one is 201. The second needs to be 202,

Shell scripting question - incrementing

2008-02-19 Thread Paul Schmehl
I could do this in perl easily, but I'm trying to force myself to learn shell scripting better. :-) I'm parsing a file to extract some elements from it, then writing the results, embeded in long strings, into an output file. Here's the script: cat file.1 | cut -d',' -f9 | sort | uniq

Re: Shell scripting question - incrementing

2008-02-19 Thread Derek Ragona
At 11:35 AM 2/19/2008, Paul Schmehl wrote: I could do this in perl easily, but I'm trying to force myself to learn shell scripting better. :-) I'm parsing a file to extract some elements from it, then writing the results, embeded in long strings, into an output file. Here's the script:

Re: Shell scripting question - incrementing

2008-02-19 Thread Pietro Cerutti
Paul Schmehl wrote: I could do this in perl easily, but I'm trying to force myself to learn shell scripting better. :-) I'm parsing a file to extract some elements from it, then writing the results, embeded in long strings, into an output file. Here's the script: cat file.1 | cut

Re: Shell scripting question - incrementing

2008-02-19 Thread Paul Schmehl
--On Tuesday, February 19, 2008 12:41:43 -0600 Derek Ragona [EMAIL PROTECTED] wrote: Thanks to all who offered suggestions. Here's a working script that creates snort rules *and* a sid-msg.map file: #!/bin/sh cat file.1 | cut -d',' -f9 | sort | uniq file.nicks i=202 j=`wc -l