com
Bill Campbell wrote on Mon, 5 Jan 2009 16:02:29 -0800:
(which we are running for Zope compatibility
as the version of Zope we're running doesn't work with python-2.5.x.
you did realize that this is another python compatibility issue, did you
;-)
Kai
--
Kai Schätzl, Berlin, Germany
Get
On Tue, Jan 06, 2009, Kai Schaetzl wrote:
com
Bill Campbell wrote on Mon, 5 Jan 2009 16:02:29 -0800:
(which we are running for Zope compatibility
as the version of Zope we're running doesn't work with python-2.5.x.
you did realize that this is another python compatibility issue, did you
;-)
Spiro Harvey wrote:
Les Mikesell lesmikes...@gmail.com wrote:
Don't count on the same stability with python. It has an annoying
habit of changing syntax in non-backwards compatible ways with no
You seem to be hell-bent (excuse the pun) on turning this into a jihad
on scripting languages.
On Mon, Jan 05, 2009, Joseph L. Casale wrote:
I need to review a logfile with Sed and cut out all the lines that start with
a certain word, problem
is this word begins after some amount of whitespace and unless I search for
whitespace at the
beginning followed by word I may encounter word
On Mon, 5 Jan 2009, Joseph L. Casale wrote:
I need to review a logfile with Sed and cut out all the lines that
start with a certain word, problem is this word begins after some
amount of whitespace and unless I search for whitespace at the
beginning followed by word I may encounter word
What about:
perl -ne 'if (/^\s*word/) { print $_; }' logfile
any others?
On Mon, Jan 5, 2009 at 11:45 AM, Joseph L. Casale
jcas...@activenetwerx.com wrote:
I need to review a logfile with Sed and cut out all the lines that start with
a certain word, problem
is this word begins after some
awk '$1 == word{print}' /var/log/messages
This example assumes that word is the first field and that it consists
only of word. If the first field is word1 this won't match.
Fixes for this are
awk '$1 ~ word{print}'
(this matches any occurrance of word in the first field)
or:
awk
The regex you want is ^[[:space:]]*word
Wow, thanks everyone for the help! How does one modify this to also knock out
lines that *must* have whitespace followed by a number [0-9]? I can do it using
^[[:space:]]*[0-9] but it also takes out lines w/o whitespace that begin with
numbers?
I have to
[0-9]? I can do it using ^[[:space:]]*[0-9] but it also takes out
lines w/o whitespace that begin with numbers?
to match one or more, use + instead of *.
* matches 0 or more, + matches 1 or more.
I have to buy a book on RegEx's and Sed :)
http://www.gnu.org/manual/gawk/gawk.pdf
(G)awk is
On Mon, 5 Jan 2009, Joseph L. Casale wrote:
The regex you want is ^[[:space:]]*word
Wow, thanks everyone for the help! How does one modify this to also
knock out lines that *must* have whitespace followed by a number
[0-9]? I can do it using ^[[:space:]]*[0-9] but it also takes out
lines
to match one or more, use + instead of *.
* matches 0 or more, + matches 1 or more.
Thanks!
I have to buy a book on RegEx's and Sed :)
http://www.gnu.org/manual/gawk/gawk.pdf
(G)awk is pretty sh!t hot where I work; however we've extended it a
bit. :)
So gawk does all that sed does and more?
So gawk does all that sed does and more? I suppose I can start with
Can't really answer that. In 15 years of using UNIX systems, I've never
touched sed. :)
With Gawk's BEGIN and END blocks you can use it to write full
programs, which is kind of nice.
that in this case, I always wanted a book
On Jan 5, 2009, at 2:56 PM, Joseph L. Casale wrote:
The regex you want is ^[[:space:]]*word
Wow, thanks everyone for the help! How does one modify this to also
knock out
lines that *must* have whitespace followed by a number [0-9]? I can
do it using
^[[:space:]]*[0-9] but it also takes
On Mon, 2009-01-05 at 13:40 -0700, Joseph L. Casale wrote:
to match one or more, use + instead of *.
* matches 0 or more, + matches 1 or more.
Thanks!
snip
So gawk does all that sed does and more? I suppose I can start with
Tons. You can write fairly complex programs with (g)awk. It
Joseph L. Casale wrote:
to match one or more, use + instead of *.
* matches 0 or more, + matches 1 or more.
Thanks!
I have to buy a book on RegEx's and Sed :)
http://www.gnu.org/manual/gawk/gawk.pdf
(G)awk is pretty sh!t hot where I work; however we've extended it a
bit. :)
So gawk
Why not just start with perl which does more than sed/awk while using
similar syntax (if you want)?
This is why:
awk '/^[[:space:]]*word/ {print}' logfile
vs
perl -ne 'if (/^\s*word/) { print $_; }' logfile
Which syntax is likely to be easier to remember?
--
Spiro Harvey
Spiro Harvey wrote:
Why not just start with perl which does more than sed/awk while using
similar syntax (if you want)?
This is why:
awk '/^[[:space:]]*word/ {print}' logfile
vs
perl -ne 'if (/^\s*word/) { print $_; }' logfile
Which syntax is likely to be easier to remember?
On Tue, Jan 06, 2009, Spiro Harvey wrote:
Why not just start with perl which does more than sed/awk while using
similar syntax (if you want)?
This is why:
awk '/^[[:space:]]*word/ {print}' logfile
vs
perl -ne 'if (/^\s*word/) { print $_; }' logfile
Which syntax is likely to be easier to
Bill Campbell wrote:
I used to some pretty complex shell and awk scripts before learning perl
about 20 years ago. Perl allowed me to do most things in a single language
including fairly low-level system calls that I previously had to do with
compiled ``C'' programs.
And you can probably
Les Mikesell lesmikes...@gmail.com wrote:
Don't count on the same stability with python. It has an annoying
habit of changing syntax in non-backwards compatible ways with no
You seem to be hell-bent (excuse the pun) on turning this into a jihad
on scripting languages. Please take the credo of
On Mon, Jan 05, 2009, Les Mikesell wrote:
Bill Campbell wrote:
I used to some pretty complex shell and awk scripts before learning perl
about 20 years ago. Perl allowed me to do most things in a single language
including fairly low-level system calls that I previously had to do with
21 matches
Mail list logo