Re: use of awk instead of complex multielement commands (was Re: 'grep -o -m' (was Re: Can't mount CD image of Win95 game))

2022-12-20 Thread David
On Wed, 21 Dec 2022 at 04:18, Lee wrote: > On 12/20/22, David wrote: > > $ echo -e '100:CD001\nXXX\n200:CD001' | awk 'BEGIN { FS=":" ; done=0 } > > /CD001/ && done==0 { print $1 - 50 ; done=1 }' > > 50 > > You can do it without flags: > > $ echo -e '100:CD001\nXXX\n200:CD001' | awk -F: '/CD001/

Re: use of awk instead of complex multielement commands (was Re: 'grep -o -m' (was Re: Can't mount CD image of Win95 game))

2022-12-20 Thread Lee
On 12/20/22, David wrote: > On Tue, 20 Dec 2022 at 22:04, David wrote: >> On Tue, 20 Dec 2022 at 22:02, David wrote: > >> > $ echo -e '100:CD001\n200:CD001' | awk 'BEGIN { FS=":" } /CD001/ && >> > NR==1 { print $1 - 50 }' >> > 50 >> >> Oops, my mistake, that's not the solution. Give me another m

Re: use of awk instead of complex multielement commands (was Re: 'grep -o -m' (was Re: Can't mount CD image of Win95 game))

2022-12-20 Thread Stefan Monnier
> Not that that is always important. But I just commented today > because so often 'awk' is ignored as if its only capability is 'print $1' > when in fact it is actually very powerful but neglected. FWIW, `sed` can also do that job. Tho the subtraction part would take a lot more work (`sed` does

Re: use of awk instead of complex multielement commands (was Re: 'grep -o -m' (was Re: Can't mount CD image of Win95 game))

2022-12-20 Thread David
On Tue, 20 Dec 2022 at 22:04, David wrote: > On Tue, 20 Dec 2022 at 22:02, David wrote: > > $ echo -e '100:CD001\n200:CD001' | awk 'BEGIN { FS=":" } /CD001/ && > > NR==1 { print $1 - 50 }' > > 50 > > Oops, my mistake, that's not the solution. Give me another minute and I > will post a better one

Re: 'grep -o -m' (was Re: Can't mount CD image of Win95 game)

2022-12-20 Thread Thomas Schmitt
Hi, The Wanderer wrote: > With the '-o' option, grep prints only the parts of the line that were > matched - but the plural here is very relevant. If that guess is > correct, then the "line" in question has *four* occurrences, so grep > prints them all - each on a separate line of output. The man

Re: use of awk instead of complex multielement commands (was Re: 'grep -o -m' (was Re: Can't mount CD image of Win95 game))

2022-12-20 Thread David
On Tue, 20 Dec 2022 at 22:02, David wrote: > $ echo -e '100:CD001\n200:CD001' | awk 'BEGIN { FS=":" } /CD001/ && > NR==1 { print $1 - 50 }' > 50 Oops, my mistake, that's not the solution. Give me another minute and I will post a better one one.

Re: use of awk instead of complex multielement commands (was Re: 'grep -o -m' (was Re: Can't mount CD image of Win95 game))

2022-12-20 Thread David
On Tue, 20 Dec 2022 at 21:53, The Wanderer wrote: > On 2022-12-20 at 05:37, David wrote: > > On Tue, 20 Dec 2022 at 21:10, The Wanderer wrote: > >> On 2022-12-20 at 02:51, Thomas Schmitt wrote: > >>> This contradicts the promises of man grep about option -m. > >> It does seem to, at least at a

use of awk instead of complex multielement commands (was Re: 'grep -o -m' (was Re: Can't mount CD image of Win95 game))

2022-12-20 Thread The Wanderer
On 2022-12-20 at 05:37, David wrote: > On Tue, 20 Dec 2022 at 21:10, The Wanderer > wrote: > >> On 2022-12-20 at 02:51, Thomas Schmitt wrote: >>> This contradicts the promises of man grep about option -m. >> >> It does seem to, at least at a glance - but I think I've figured >> out what's going

Re: 'grep -o -m' (was Re: Can't mount CD image of Win95 game)

2022-12-20 Thread David
On Tue, 20 Dec 2022 at 21:10, The Wanderer wrote: > On 2022-12-20 at 02:51, Thomas Schmitt wrote: > >>> offst=$( expr \ > >>> $( grep -a -o -b -m 1 CD001 cdimage.iso \ > >>> | sed -e 's/:/ /' \ > >>> | awk '{ print $1 }' ) - 32769 ) > > > > The Wande

Re: grep replacement using sed is behaving oddly

2022-10-22 Thread Max Nikulin
On 22/10/2022 20:23, Gary Dale wrote:     sed -i '//d' *.html did the trick. I would suggest you to use more specific pattern to avoid removing of meaningful text due to a lost newline character: sed -i -e '/^\s*]*>\s*$/d' "." in regexp may be a source of surprises (or catastrophic backtr

Re: grep replacement using sed is behaving oddly

2022-10-22 Thread Gary Dale
On 2022-10-21 15:14, David Wright wrote: On Fri 21 Oct 2022 at 14:15:01 (-0400), Greg Wooledge wrote: On Fri, Oct 21, 2022 at 08:01:00PM +0200, to...@tuxteam.de wrote: On Fri, Oct 21, 2022 at 01:21:44PM -0400, Gary Dale wrote: I'm hoping someone can tell me what I'm doing wrong. I have a line

Re: grep replacement using sed is behaving oddly

2022-10-21 Thread tomas
On Sat, Oct 22, 2022 at 10:32:24AM +0700, Max Nikulin wrote: > On 22/10/2022 02:09, The Wanderer wrote: > > > > 'info sed', section 'sed regular expressions', subsection 'regular > > expression extensions': > > While a reader may find more interesting stuff lying around while traveling > by this

Re: grep replacement using sed is behaving oddly

2022-10-21 Thread Max Nikulin
On 22/10/2022 02:09, The Wanderer wrote: 'info sed', section 'sed regular expressions', subsection 'regular expression extensions': While a reader may find more interesting stuff lying around while traveling by this path, there is a shorthand info "(sed) regexp extensions" and alternatives

Re: grep replacement using sed is behaving oddly

2022-10-21 Thread The Wanderer
On 2022-10-21 at 16:16, Greg Wooledge wrote: > On Fri, Oct 21, 2022 at 03:09:32PM -0400, The Wanderer wrote: > >> IOW, each seems to be half of the usual '\b' (edge of a word) set. >> With the default sed behavior (not sure whether that's basic >> regular expressions or extended regular expressio

Re: grep replacement using sed is behaving oddly

2022-10-21 Thread Greg Wooledge
On Fri, Oct 21, 2022 at 03:09:32PM -0400, The Wanderer wrote: > IOW, each seems to be half of the usual '\b' (edge of a word) set. With > the default sed behavior (not sure whether that's basic regular > expressions or extended regular expressions, in the nomenclature of the > info document), you c

Re: grep replacement using sed is behaving oddly

2022-10-21 Thread David Wright
On Fri 21 Oct 2022 at 14:15:01 (-0400), Greg Wooledge wrote: > On Fri, Oct 21, 2022 at 08:01:00PM +0200, to...@tuxteam.de wrote: > > On Fri, Oct 21, 2022 at 01:21:44PM -0400, Gary Dale wrote: > > > I'm hoping someone can tell me what I'm doing wrong. I have a line in a > > > lot > > > of HTML file

Re: grep replacement using sed is behaving oddly

2022-10-21 Thread The Wanderer
On 2022-10-21 at 14:15, Greg Wooledge wrote: > So... yeah, \< and/or \> clearly have some special meaning to GNU > sed. Good luck figuring out what that is. 'info sed', section 'sed regular expressions', subsection 'regular expression extensions': >> '\<' >> Matches the beginning of a word.

Re: grep replacement using sed is behaving oddly

2022-10-21 Thread tomas
On Fri, Oct 21, 2022 at 02:15:01PM -0400, Greg Wooledge wrote: > On Fri, Oct 21, 2022 at 08:01:00PM +0200, to...@tuxteam.de wrote: > > On Fri, Oct 21, 2022 at 01:21:44PM -0400, Gary Dale wrote: > > > I'm hoping someone can tell me what I'm doing wrong. I have a line in a > > > lot > > > of HTML fi

Re: grep replacement using sed is behaving oddly

2022-10-21 Thread Greg Wooledge
On Fri, Oct 21, 2022 at 08:01:00PM +0200, to...@tuxteam.de wrote: > On Fri, Oct 21, 2022 at 01:21:44PM -0400, Gary Dale wrote: > > I'm hoping someone can tell me what I'm doing wrong. I have a line in a lot > > of HTML files that I'd like to remove. The line is: > > > >     > > > > I'm t

Re: grep replacement using sed is behaving oddly

2022-10-21 Thread tomas
On Fri, Oct 21, 2022 at 01:50:29PM -0400, Greg Wooledge wrote: > On Fri, Oct 21, 2022 at 01:21:44PM -0400, Gary Dale wrote: > >  sed -i -s 's/\s*\//g' history.html > > > > Unfortunately, the replacement doesn't remove the line but rather leaves me > > with: > > > >     <;"> > > The 's' c

Re: grep replacement using sed is behaving oddly

2022-10-21 Thread tomas
On Fri, Oct 21, 2022 at 01:21:44PM -0400, Gary Dale wrote: > I'm hoping someone can tell me what I'm doing wrong. I have a line in a lot > of HTML files that I'd like to remove. The line is: > >     > > I'm testing the sed command to remove it on just one file. When it works, > I'll run

Re: grep replacement using sed is behaving oddly

2022-10-21 Thread Greg Wooledge
On Fri, Oct 21, 2022 at 01:21:44PM -0400, Gary Dale wrote: >  sed -i -s 's/\s*\//g' history.html > > Unfortunately, the replacement doesn't remove the line but rather leaves me > with: > >     <;"> The 's' command in sed doesn't remove lines. It performs a substitution within a line. T

Re: grep: show matching line from pattern file

2022-06-03 Thread DdB
Hello, of course, there are different ways to solve this, i like the perl approach. Only since i myself am not all that familiar with the language, i'd like to add 2 pointers: (M)AWK scripting language can do similar things (read syslog once, loop over regular expressions and output anything you w

Re: grep: show matching line from pattern file

2022-06-03 Thread Richard Hector
On 3/06/22 07:17, Greg Wooledge wrote: On Thu, Jun 02, 2022 at 03:12:23PM -0400, duh wrote: > > Jim Popovitch wrote on 28/05/2022 21:40: > > > I have a file of regex patterns and I use grep like so: > > > > > > ~$ grep -f patterns.txt /var/log/syslog > > > > > > What I'd like to get is a

Re: grep: show matching line from pattern file

2022-06-02 Thread Will Mengarini
* David Christensen [22-06/02=Thu 15:50 -0700]: > On 6/2/22 15:13, Will Mengarini wrote: >> * Greg Wooledge [22-05/28=Sa 17:11 -0400]: >>> [...] >>> #!/usr/bin/perl >>> use strict; use warnings; >>> [...] >>> open PATS, ">> [...] >> >> You need "or die", not "|| die", because of precedence: what

Re: grep: show matching line from pattern file

2022-06-02 Thread David Christensen
On 6/2/22 15:13, Will Mengarini wrote: * Greg Wooledge [22-05/28=Sa 17:11 -0400]: [...] #!/usr/bin/perl use strict; use warnings; [...] open PATS, " You need "or die", not "|| die", because of precedence: what you coded checks whether " +1 That is a good explanation of a Perl fine point/ go

Re: grep: show matching line from pattern file

2022-06-02 Thread Will Mengarini
* Greg Wooledge [22-05/28=Sa 17:11 -0400]: > [...] > #!/usr/bin/perl > use strict; use warnings; > [...] > open PATS, " [...] You need "or die", not "|| die", because of precedence: what you coded checks whether " perl -le"print unpack '%C*',MENGARINI"

Re: grep: show matching line from pattern file

2022-06-02 Thread Greg Wooledge
On Thu, Jun 02, 2022 at 03:12:23PM -0400, duh wrote: > > > Jim Popovitch wrote on 28/05/2022 21:40: > > > > I have a file of regex patterns and I use grep like so: > > > > > > > > ~$ grep -f patterns.txt /var/log/syslog > > > > > > > > What I'd like to get is a listing of all lines, specifi

Re: grep: show matching line from pattern file

2022-06-02 Thread duh
On 5/29/22 9:44 AM, David Wright wrote: On Sun 29 May 2022 at 15:02:35 (+0200), Jörg-Volker Peetz wrote: Jim Popovitch wrote on 28/05/2022 21:40: Not exactly Debian specific, but hoping that someone here can help. I have a file of regex patterns and I use grep like so: ~$ grep -f patte

Re: grep: show matching line from pattern file

2022-05-29 Thread Jim Popovitch
On Sat, 2022-05-28 at 17:11 -0400, Greg Wooledge wrote: > On Sat, May 28, 2022 at 04:02:39PM -0400, The Wanderer wrote: > > On 2022-05-28 at 15:40, Jim Popovitch wrote: > > > I have a file of regex patterns and I use grep like so: > > > > > >    ~$ grep -f patterns.txt /var/log/syslog > > > > >

Re: grep: show matching line from pattern file

2022-05-29 Thread David Wright
On Sun 29 May 2022 at 15:02:35 (+0200), Jörg-Volker Peetz wrote: > Jim Popovitch wrote on 28/05/2022 21:40: > > Not exactly Debian specific, but hoping that someone here can help. > > > > I have a file of regex patterns and I use grep like so: > > > > ~$ grep -f patterns.txt /var/log/syslog >

Re: grep: show matching line from pattern file

2022-05-29 Thread Jörg-Volker Peetz
Jim Popovitch wrote on 28/05/2022 21:40: Not exactly Debian specific, but hoping that someone here can help. I have a file of regex patterns and I use grep like so: ~$ grep -f patterns.txt /var/log/syslog What I'd like to get is a listing of all lines, specifically the line numbers of the

Re: grep: show matching line from pattern file

2022-05-28 Thread The Wanderer
On 2022-05-28 at 17:11, Greg Wooledge wrote: > On Sat, May 28, 2022 at 04:02:39PM -0400, The Wanderer wrote: > >> On 2022-05-28 at 15:40, Jim Popovitch wrote: >> > I have a file of regex patterns and I use grep like so: >> > >> >~$ grep -f patterns.txt /var/log/syslog >> > >> > What I'd lik

Re: grep: show matching line from pattern file

2022-05-28 Thread Greg Wooledge
On Sat, May 28, 2022 at 04:02:39PM -0400, The Wanderer wrote: > On 2022-05-28 at 15:40, Jim Popovitch wrote: > > I have a file of regex patterns and I use grep like so: > > > >~$ grep -f patterns.txt /var/log/syslog > > > > What I'd like to get is a listing of all lines, specifically the lin

Re: grep: show matching line from pattern file

2022-05-28 Thread The Wanderer
On 2022-05-28 at 15:40, Jim Popovitch wrote: > Not exactly Debian specific, but hoping that someone here can help. > > I have a file of regex patterns and I use grep like so: > >~$ grep -f patterns.txt /var/log/syslog > > What I'd like to get is a listing of all lines, specifically the lin

Re: Grep on dictionary words

2009-11-30 Thread Mike Castle
On Sat, Nov 28, 2009 at 7:13 AM, Dotan Cohen wrote: > I have a long binary file (about 12 MB) that I need to extract the > text from via "strings". Naturally, there are a lot of junk lines such > as these: > pDuf > #k0H}g) > GoV5 > rLeY1 > TMlq,* > > Is there a way to grep the output of strings in

Re: Grep on dictionary words

2009-11-30 Thread Andrew Sackville-West
On Sun, Nov 29, 2009 at 11:14:58AM +0200, Dotan Cohen wrote: > 2009/11/29 Andrew Sackville-West : > > On Sun, Nov 29, 2009 at 01:22:15AM +0200, Dotan Cohen wrote: > >> > will get the ones that start with capital alphas. if you want initial > >> > caps *only* then: > >> > > >> > grep "^[A-Z][a-z]*$"

Re: Grep on dictionary words

2009-11-29 Thread Emanoil Kotsev
Dotan Cohen wrote: > > This means that only words that start with a caps are valid. I need > "can start with a caps, but caps can be nowhere else". I got that like > this: > grep "^[A-Za-z][a-z]*$" > However I think that there is a better way. > > This is a good exercise. I am bettering my regex

Re: Grep on dictionary words

2009-11-29 Thread Dotan Cohen
2009/11/29 Andrew Sackville-West : > On Sun, Nov 29, 2009 at 01:22:15AM +0200, Dotan Cohen wrote: >> > will get the ones that start with capital alphas. if you want initial >> > caps *only* then: >> > >> > grep "^[A-Z][a-z]*$" >> > >> > would match those. >> > >> >> Thanks. I meant that caps could

Re: Grep on dictionary words

2009-11-29 Thread Tzafrir Cohen
On Sun, Nov 29, 2009 at 01:22:15AM +0200, Dotan Cohen wrote: > > will get the ones that start with capital alphas. if you want initial > > caps *only* then: > > > > grep "^[A-Z][a-z]*$" > > > > would match those. > > > > Thanks. I meant that caps could only be at the beginning of a word, > not in

Re: Grep on dictionary words

2009-11-28 Thread John Hasler
Dotan writes: > Is there a way to grep the output of strings in order to only show > lines that contain words found in the aspell dictionary? Try this: #!/bin/bash strings "$1" | while read line do if [ ` echo "$line" | sed -e 's/[^a-zA-Z ]//g' | wc -m` -lt 6 ] then continue fi echo "$line" | s

Re: Grep on dictionary words

2009-11-28 Thread Andrew Sackville-West
On Sun, Nov 29, 2009 at 01:22:15AM +0200, Dotan Cohen wrote: > > will get the ones that start with capital alphas. if you want initial > > caps *only* then: > > > > grep "^[A-Z][a-z]*$" > > > > would match those. > > > > Thanks. I meant that caps could only be at the beginning of a word, > not in

Re: Grep on dictionary words

2009-11-28 Thread Dotan Cohen
> will get the ones that start with capital alphas. if you want initial > caps *only* then: > > grep "^[A-Z][a-z]*$" > > would match those. > Thanks. I meant that caps could only be at the beginning of a word, not in the middle. Expanding your example, I figured that would be: grep "^[A-Z]?[a-z]*$

Re: Grep on dictionary words

2009-11-28 Thread Andrew Sackville-West
On Sun, Nov 29, 2009 at 12:00:33AM +0200, Dotan Cohen wrote: > > ISTM that because the output of strings is not discrete list of > > potential words, but is instead a long list of concatenated > > characters, this problem is really rather daunting. The output should > > probably be first broken up

Re: Grep on dictionary words

2009-11-28 Thread Florian Kriener
On Saturday 28 November 2009 16:13:55 Dotan Cohen wrote: > I have a long binary file (about 12 MB) that I need to extract the > text from via "strings". Naturally, there are a lot of junk lines > such as these: > pDuf > #k0H}g) > GoV5 > rLeY1 > TMlq,* > > Is there a way to grep the output of stri

Re: Grep on dictionary words

2009-11-28 Thread Dotan Cohen
> ISTM that because the output of strings is not discrete list of > potential words, but is instead a long list of concatenated > characters, this problem is really rather daunting. The output should > probably be first broken up into something resembling words by perhaps > breaking on non-alphabet

Re: Grep on dictionary words

2009-11-28 Thread Andrew Sackville-West
On Sat, Nov 28, 2009 at 11:32:59AM -0600, Boyd Stephen Smith Jr. wrote: > In <880dece00911280713n6193b8das6970e8a071fc2...@mail.gmail.com>, Dotan Cohen > wrote: > >Is there a way to grep the output of strings in order to only show > >lines that contain words found in the aspell dictionary? Thanks

Re: Grep on dictionary words

2009-11-28 Thread Boyd Stephen Smith Jr.
In <880dece00911280713n6193b8das6970e8a071fc2...@mail.gmail.com>, Dotan Cohen wrote: >Is there a way to grep the output of strings in order to only show >lines that contain words found in the aspell dictionary? Thanks in >advance. I once wrote a small program against the aspell API to do somethin

Re: Grep for colums?

2009-02-14 Thread Jörg-Volker Peetz
Nagy Daniel wrote: > the "text" is here: > > http://pastebin.com/f37214a30 > > and I only want this string: > > http://downloads.sourceforge.net/portableapps/nvu_portable_1.0_rev_5_en-us.paf.exe?download > > so I want to search like: > | grep downloads.sourceforge.net

Re: Grep for colums?

2009-02-12 Thread Chris Davies
Nagy Daniel wrote: > cat text.txt | perl -ne 'print "$1\n" while (/href=\"(.+?)\"/ig)' | grep > sourceforge | grep nvu You don't need cat for a single file! perl -ne 'print "$1\n" while (/href=\"(.+?)\"/ig)' text.txt | grep sourceforge | grep nvu Or, by using perl in a single comma

Re: Grep for colums?

2009-02-12 Thread Martin
Hi, mar...@localhost:~/2delete$ cat columns.txt 1 2 3 a b c 1 2 3 4 a b c d mar...@localhost:~/2delete$ awk '$2 == "b"' columns.txt a b c a b c d mar...@localhost:~/2delete$ awk '$2 == "2"' columns.txt 1 2 3 1 2 3 4 2009/2/11 Nagy Daniel : > Is there a methodfor searching in colums just like gr

Re: Grep for colums?

2009-02-11 Thread Nagy Daniel
Thank you!!! The solution was this: cat text.txt | perl -ne 'print "$1\n" while (/href=\"(.+?)\"/ig)' | grep sourceforge | grep nvu 2009/2/11 Michael Iatrou > When the date was Wednesday 11 February 2009, Nagy Daniel wrote: > > > the "text" is here: > > > > http://pastebin.com/f37214a30 > > >

Re: Grep for colums?

2009-02-11 Thread Michael Iatrou
When the date was Wednesday 11 February 2009, Nagy Daniel wrote: > the "text" is here: > > http://pastebin.com/f37214a30 > > and I only want this string: > > http://downloads.sourceforge.net/portableapps/nvu_portable_1.0_rev_5_en-u >s.paf.exe?download It seems to me that you only want to grab url

Re: Grep for colums?

2009-02-11 Thread Γιώργος Πάλλας
Nagy Daniel wrote: > > the "text" is here: > > http://pastebin.com/f37214a30 > > and I only want this string: > > http://downloads.sourceforge.net/portableapps/nvu_portable_1.0_rev_5_en-us.paf.exe?download > > so I want to search like: > | grep downloads.sourceforge.net

Re: Grep for colums?

2009-02-11 Thread Paul E Condon
On 2009-02-11_12:09:20, Nagy Daniel wrote: > Is there a methodfor searching in colums just like grep does in rows, but i > don't know how many colums I will have, so: awk is not good, beacuse awk > {print $1$2$3} it's not a good soultion:S i have too many colums Yes, and its call SQL. If you only

Re: Grep for colums?

2009-02-11 Thread Johann Spies
On Wed, Feb 11, 2009 at 12:26:07PM +0100, Nagy Daniel wrote: > the "text" is here: > > http://pastebin.com/f37214a30 I have copied that into a file /tmp/w > > and I only want this string: > > http://downloads.sourceforge.net/portableapps/ > nvu_portable_1.0_rev_5_en-us.paf.exe?download % gre

Re: Grep for colums?

2009-02-11 Thread Nagy Daniel
the "text" is here: http://pastebin.com/f37214a30 and I only want this string: http://downloads.sourceforge.net/portableapps/nvu_portable_1.0_rev_5_en-us.paf.exe?download so I want to search like: | grep downloads.sourceforge.net | grep nvu but the text isn't separated with enters, and I want to

Re: Grep for colums?

2009-02-11 Thread Γιώργος Πάλλας
Nagy Daniel wrote: Is there a methodfor searching in colums just like grep does in rows, but i don't know how many colums I will have, so: awk is not good, beacuse awk {print $1$2$3} it's not a good soultion:S i have too many colums There is always perl! If you send an example of what yo

Re: grep trick

2008-04-11 Thread Kamaraju S Kusumanchi
Osamu Aoki wrote: > > Also, "GREP_COLORS" should be used instead of "GREP_COLOR". I just now checked the man page of grep 2.5.3~dfsg-5 in unstable. It looks like GREP_COLORS is newly introduced deprecating the use of GREP_COLOR. GREP_COLORS did not exist in grep 2.5.1.ds2-6 (for Etch). Thanks fo

Re: grep trick

2008-04-11 Thread Osamu Aoki
On Mon, Apr 07, 2008 at 10:58:43PM -0400, Kamaraju S Kusumanchi wrote: > Rich Healey wrote: > > > Mike Bird wrote: > >> On Mon April 7 2008 16:03:28 Chris Bannister wrote: > >>> export GREP_COLOR=33 > >>> alias grep='grep --colour=always' > >> > >> This will break any scripts which assume that th

Re: grep trick

2008-04-10 Thread Joost Witteveen
On 09/04/2008, Chris Bannister <[EMAIL PROTECTED]> wrote: > On Tue, Apr 08, 2008 at 10:22:08AM +1000, Rich Healey wrote: > > -BEGIN PGP SIGNED MESSAGE- > > Hash: SHA1 > > > > Mike Bird wrote: > > > On Mon April 7 2008 16:03:28 Chris Bannister wrote: > > >> export GREP_COLOR=33 > > >>

Re: grep trick

2008-04-09 Thread Chris Bannister
On Tue, Apr 08, 2008 at 10:22:08AM +1000, Rich Healey wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Mike Bird wrote: > > On Mon April 7 2008 16:03:28 Chris Bannister wrote: > >> export GREP_COLOR=33 > >> alias grep='grep --colour=always' > > > > This will break any scripts which as

Re: grep trick

2008-04-09 Thread Chris Bannister
On Mon, Apr 07, 2008 at 06:49:20PM -0500, Kevin Monceaux wrote: > On Tue, 8 Apr 2008, Chris Bannister wrote: >> You can always try different values of GREP_COLOR. Although I can't >> seem to get yellow. > > After another moment of Googling, for yellow, use: > > setenv GREP_COLOR '1;33' > > or your

Re: grep trick

2008-04-07 Thread Kamaraju S Kusumanchi
Rich Healey wrote: > Mike Bird wrote: >> On Mon April 7 2008 16:03:28 Chris Bannister wrote: >>> export GREP_COLOR=33 >>> alias grep='grep --colour=always' >> >> This will break any scripts which assume that the output >> of grep has not been annotated with color escape sequences. >> > Those scr

Re: grep trick

2008-04-07 Thread Rich Healey
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mike Bird wrote: > On Mon April 7 2008 16:03:28 Chris Bannister wrote: >> export GREP_COLOR=33 >> alias grep='grep --colour=always' > > This will break any scripts which assume that the output > of grep has not been annotated with color escape sequenc

Re: grep trick

2008-04-07 Thread Kevin Monceaux
Chris, On Tue, 8 Apr 2008, Chris Bannister wrote: In your .bashrc put: export GREP_COLOR=33 alias grep='grep --colour=always' Very cool tip!! In my case, however, my .cshrc file might be a better choice since I don't use bash, and of course the syntax is different. As someone else pointed

Re: grep trick

2008-04-07 Thread Mike Bird
On Mon April 7 2008 16:03:28 Chris Bannister wrote: > export GREP_COLOR=33 > alias grep='grep --colour=always' This will break any scripts which assume that the output of grep has not been annotated with color escape sequences. --Mike Bird -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a

Re: grep trick

2008-04-07 Thread mike
Chris Bannister wrote: Hi, If you work on the command line, here is a handy grep trick. In your .bashrc put: export GREP_COLOR=33 alias grep='grep --colour=always' You can always try different values of GREP_COLOR. Although I can't seem to get yellow. Remember to: source .bashrc be

Re: grep | sed do not function inline?

2007-04-27 Thread nicholas
Michelle Konzack said: Am 2007-04-22 19:32:18, schrieb nicholas: I've seen the same thing with tail -f, and it confuses me as well. I look forward to an expert answer! In this case, sed alone can handle the job, if you want to avoid perl: tail -f mylog | sed -n '/smtg/s/end/notend/p' tai

Re: grep | sed do not function inline?

2007-04-27 Thread Michelle Konzack
Am 2007-04-22 19:32:18, schrieb nicholas: > I've seen the same thing with tail -f, and it confuses me as well. > I look forward to an expert answer! > > In this case, sed alone can handle the job, if you want to avoid perl: > > tail -f mylog | sed -n '/smtg/s/end/notend/p' tail -f mylog | se

Re: grep | sed do not function inline?

2007-04-27 Thread Michelle Konzack
Am 2007-04-23 11:32:53, schrieb Greg Folkert: > Tyler, look at what "tail -f" it means (basically): > > -f, --follow[={name|descriptor}] > output appended data as the file grows; -f, --follow, and > --follow=descriptor are equivalent > > Which mean it will sit watc

Re: grep | sed do not function inline?

2007-04-23 Thread nicholas
Tyler Smith said: How do you actually run tail with -f? Do you just let it go in it's own xterm and periodically check to see if it has spit out anything of concern? Or can you use it in a terminal you're using for other tasks as a background process? Sounds useful, but I'm not sure exactly how

Re: grep | sed do not function inline?

2007-04-23 Thread Tyler Smith
On 2007-04-23, Greg Folkert <[EMAIL PROTECTED]> wrote: > > Tyler, look at what "tail -f" it means (basically): > > -f, --follow[=3D{name|descriptor}] > output appended data as the file grows; -f, --follow, and > --follow=3Ddescriptor are equivalent > > Which mean it

Re: grep | sed do not function inline?

2007-04-23 Thread Greg Folkert
On Mon, 2007-04-23 at 00:06 +, Tyler Smith wrote: > On 2007-04-22, bilbo <[EMAIL PROTECTED]> wrote: > > log file which contains a lot of information. I wanted to extract some > > informations out of it. But when I tried to > > > > tail -f mylog | grep 'smtg' | sed -n 's/end/notend/p' > > > > no

Re: grep | sed do not function inline?

2007-04-23 Thread bilbo
Hi all, To Tyler: no the other difference is that if I let it run, the lines will appear when the file is filled. tail-f will follow it. And that's actually the part I'm interested in, not in the last 10 lines, but in the lines that will be added afterward. To Mike: I have tried with this --line

Re: grep | sed do not function inline?

2007-04-22 Thread nicholas
I've seen the same thing with tail -f, and it confuses me as well. I look forward to an expert answer! In this case, sed alone can handle the job, if you want to avoid perl: tail -f mylog | sed -n '/smtg/s/end/notend/p' -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubsc

Re: grep | sed do not function inline?

2007-04-22 Thread Mike Bird
On Sunday 22 April 2007 16:13, bilbo wrote: > Recently I faced a strange behaviour of the Linux commands. I have a > log file which contains a lot of information. I wanted to extract some > informations out of it. But when I tried to > > tail -f mylog | grep 'smtg' | sed -n 's/end/notend/p' > > no

Re: grep | sed do not function inline?

2007-04-22 Thread Tyler Smith
On 2007-04-22, bilbo <[EMAIL PROTECTED]> wrote: > log file which contains a lot of information. I wanted to extract some > informations out of it. But when I tried to > > tail -f mylog | grep 'smtg' | sed -n 's/end/notend/p' > > no output could be found. Which was quite surprising since the > follo

Re: grep highlighting

2006-09-28 Thread Jeff D
T wrote: On Thu, 28 Sep 2006 14:24:21 -0700, Jeff D wrote: The recent grep supports highlighting. How can I make it works? try this out: export GREP_OPTIONS='--color=auto' GREP_COLOR='1;31' Thanks a lot! That's fast! It works! What does the GREP_COLOR='1;31' mean, where c

Re: grep highlighting

2006-09-28 Thread T
On Thu, 28 Sep 2006 14:24:21 -0700, Jeff D wrote: >> The recent grep supports highlighting. How can I make it works? >> > try this out: > > export GREP_OPTIONS='--color=auto' GREP_COLOR='1;31' Thanks a lot! That's fast! It works! What does the GREP_COLOR='1;31' mean, where can I find info f

Re: grep highlighting

2006-09-28 Thread Jeff D
T wrote: Hi The recent grep supports highlighting. How can I make it works? thanks PS. I tried: export GREP_COLOR=red echo abcd | grep abc try this out: export GREP_OPTIONS='--color=auto' GREP_COLOR='1;31' -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscri

Re: Grep

2006-05-29 Thread Juha Tuuna
On Saturday, 27. May 2006 20:21, Richard wrote: > This would be great, but I think mp3info, only works with id3 1 tags, > and not 1.1 of 1.2 or 2.2 or 2.3 tags > > Rich Check this out http://www.codeproject.com/audio/mp3info-by-shoonya.asp Maybe it helps, maybe it doesn't. -- -=[JT]=- -- To UN

Re: Grep

2006-05-26 Thread Juha Tuuna
On Friday, 26. May 2006 02:04, Richard wrote: > Is there a way to read mp3 ID3 tags using greg?, > to find a certain information. > ie. joint stereo, and being able to select those, and delete them, > from the folder. > > Regards > Rich install and try mp3info It's capable of finding all sorts of i

Re: Grep

2006-05-26 Thread Olafur Jens Sigurdsson
Þann 2006-05-25, 19:04:36 (-0400) skrifaði Richard: > Is there a way to read mp3 ID3 tags using greg?, > to find a certain information. > ie. joint stereo, and being able to select those, and delete them, > from the folder. You have to use an external tool (something like eyed3 on the mp3 files) a

Re: grep bug?

2005-09-22 Thread Enrique Morfin
> wrong regexp usage, and whats wrong with the output > ?? what columns? > you mean rows ?? > Nop. I mean columns. Example: p kernel-image-2.6.8-2-k7-smp - Linux kernel image for version 2.6.8 on AMD K7 SMP. is cut to: p kernel-image-2.6.8-2-k7-smp - L

Re: grep bug?

2005-09-21 Thread Frank Gevaerts
On Wed, Sep 21, 2005 at 02:20:12PM -0700, Enrique Morfin wrote: > > if: > > $aptitude search kernel-image > v kernel-image snipped > > if: > $ aptitude search kernel-image|grep 2.6 > p kernel-image-2.4.27-2-686 - Linux kernel > image for version 2

Re: grep bug?

2005-09-21 Thread garaged
wrong regexp usage, and whats wrong with the output ?? what columns? you mean rows ?? $ aptitude search kernel-image|grep 2\.6|wc -l 49 $ aptitude search kernel-image|wc -l 76 -- Linux garaged 2.6.9-rc1-mm1 #3 SMP Mon Aug 30 12:14:50 CDT 2004 i686 Intel(R) Pentium(R) 4 CPU 2.80GHz GenuineInte

Re: GREP

2005-08-06 Thread Kevin Mark
On Fri, Aug 05, 2005 at 11:25:47AM -0500, Ed Curtis wrote: > > I need some help with grep. In fact I'm not really sure grep is what I > should be using. I would list to find the number of files containing a > string. Not the number of times the string appears in a single file. > > Say I'm search

Re: GREP

2005-08-05 Thread michael
On Fri, 2005-08-05 at 11:25 -0500, Ed Curtis wrote: > I need some help with grep. In fact I'm not really sure grep is what I > should be using. I would list to find the number of files containing a > string. Not the number of times the string appears in a single file. > > Say I'm searching the /v

Re: grep & tar segfault - broken system

2005-01-07 Thread Rem
Ok guys, same for me ( sarge ) : lusig1:~# md5sum /usr/bin/find 5e8f27978c90c500b213f67ec759db2a /usr/bin/find lusig1:~# md5sum /bin/grep 03e99cc8532668c2cf198c3a6795cc26 /bin/grep lusig1:~# md5sum /bin/tar 4a1f9c9a1679faaf66073c96f1435284 /bin/tar lusig1:~# On Thu, 6 Jan 2005 23:42:12 -05

Re: grep & tar segfault - broken system

2005-01-06 Thread Jason Rennie
On Mon, Jan 03, 2005 at 06:45:38PM +0200, Alexandros Papadopoulos wrote: > This is all too strange and I'd like to know if there is anywhere I can > find known good md5sums of Debian package binaries (not of the packages > themselves - of the executables in'em). Otherwise, it's impossible to > k

Re: grep & tar segfault - broken system

2005-01-03 Thread Alexandros Papadopoulos
On Monday 03 January 2005 12:59, Alexandros Papadopoulos wrote: > [0] GREP segfaults: > helios:/# grep > Segmentation fault > [1] TAR segfaults too: > helios:/# tar -cf boot.tar boot/ > Segmentation fault On closer inspection, I realised that "find" segfaulted too. I also checked the md5sums of

Re: Grep only mail headers via STDIN?

2004-03-05 Thread Pigeon
On Fri, Mar 05, 2004 at 10:37:01AM +0100, Jens Benecke wrote: > Hi, > > I want to create a script that greps for a specific mail header coming from > STDIN. "mailgrep" and "mboxgrep" don't work, they need files to work on, > but the mail comes via STDIN. > > So I need to write something like > >

Re: Grep only mail headers via STDIN?

2004-03-05 Thread Ken Irving
On Fri, Mar 05, 2004 at 09:55:43AM -0900, Ken Irving wrote: > On Fri, Mar 05, 2004 at 10:37:01AM +0100, Jens Benecke wrote: > > Hi, > > > > I want to create a script that greps for a specific mail header coming from > > STDIN. "mailgrep" and "mboxgrep" don't work, they need files to work on, > > b

Re: Grep only mail headers via STDIN?

2004-03-05 Thread Ken Irving
On Fri, Mar 05, 2004 at 10:37:01AM +0100, Jens Benecke wrote: > Hi, > > I want to create a script that greps for a specific mail header coming from > STDIN. "mailgrep" and "mboxgrep" don't work, they need files to work on, > but the mail comes via STDIN. > > So I need to write something like > >

Re: Grep only mail headers via STDIN?

2004-03-05 Thread Jens Benecke
Joost De Cock wrote: > On Friday 05 March 2004 10:37, Jens Benecke shoved this in my mailbox: >> I want to create a script that greps for a specific mail header coming >> from STDIN. "mailgrep" and "mboxgrep" don't work, they need files to work >> on, but the mail comes via STDIN. > > I'm not say

Re: Grep only mail headers via STDIN?

2004-03-05 Thread Joost De Cock
On Friday 05 March 2004 10:37, Jens Benecke shoved this in my mailbox: > I want to create a script that greps for a specific mail header coming from > STDIN. "mailgrep" and "mboxgrep" don't work, they need files to work on, > but the mail comes via STDIN. I'm not saying this can't be done from a s

Re: grep-available

2004-01-29 Thread Nano Nano
On Fri, Jan 30, 2004 at 02:26:40AM +, Colin Watson wrote: > On Thu, Jan 29, 2004 at 03:31:44PM -0800, Nano Nano wrote: > > What is the precise definition of "available"? > > Whatever's in your available file (/var/lib/dpkg/available). Remember to > run 'dselect update' rather than 'apt-get upd

Re: grep-available

2004-01-29 Thread Colin Watson
On Thu, Jan 29, 2004 at 03:31:44PM -0800, Nano Nano wrote: > What is the precise definition of "available"? Whatever's in your available file (/var/lib/dpkg/available). Remember to run 'dselect update' rather than 'apt-get update' to keep this up to date. I believe only the latest version of each

Re: grep-dctrl

2003-07-05 Thread Colin Watson
On Sat, Jul 05, 2003 at 01:30:14AM +0200, Rudy Gevaert wrote: > I installed mysql-server on my server, and now I want to install lynx > and/or ntpclient. This gives an error: > > kain:/var/log/apache# apt-get install lynx > Reading Package Lists... Done > Building Dependency Tree... Done > The fo

  1   2   >