[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: grep
From: |
Stepan Kasal |
Subject: |
Re: grep |
Date: |
Mon, 24 May 2004 10:41:02 +0200 |
User-agent: |
Mutt/1.4.1i |
Hello,
On Sun, May 23, 2004 at 08:57:22PM -0400, Paul Jarc wrote:
> "Alexander James Mattam" <address@hidden> wrote:
> > grep [:digit:] what should it return???
>
> It should output lines that contain :, d, i, g, or t. (But without
> quotes, the shell may change the pattern.)
this answer was right, of course. I was too quick writing my answer.
And, to clarify:
To get lines containing at least one digit, use:
grep '[[:digit:]]'
To get lines containing only digits:
grep '^[[:digit:]]*$'
To get non-empty lines containing only digits:
grep -E '^[[:digit:]]+$'
HTH,
Stepan Kasal
- grep, Alexander James Mattam, 2004/05/23
- Re: grep, Paul Jarc, 2004/05/23
- Re: grep,
Stepan Kasal <=
- Re: grep, Stepan Kasal, 2004/05/24
- Re: grep, Chris F.A. Johnson, 2004/05/24