Re: Beginner Question (related to homework)
- From: Stephane CHAZELAS <this.address@xxxxxxxxxx>
- Date: Wed, 26 Sep 2007 20:06:56 GMT
2007-09-24, 14:34(-07), prelim_questions@xxxxxxxxx:
I need to perform a complicated (for me) operation at the command line[...]
using a series of pipes, but not using grep, sed, or awk.
At one point I may have a list as follows:
1.2
3.45
6.7
a
bc
Is there an easy way to count only the numeric lines? I do not know
in advance how many lines are numbers and how many are strictly
alphabetic. There are no mixed lines.
If it has to be convoluted and not obvious and not legible, you
could do things like:
< list tr -cs 0-9. '[\n*]' | wc -l
of course, that doesn't work if there are lines containing both
alphabetics and numbers, or lines with digits and several dots...
--
Stéphane
.
- Follow-Ups:
- Re: Beginner Question (related to homework)
- From: Stephane CHAZELAS
- Re: Beginner Question (related to homework)
- References:
- Beginner Question (related to homework)
- From: prelim_questions
- Beginner Question (related to homework)
- Prev by Date: Re: Handling signals properly?
- Next by Date: Re: difference between gmake and make: $< macro
- Previous by thread: Re: Beginner Question (related to homework)
- Next by thread: Re: Beginner Question (related to homework)
- Index(es):
Relevant Pages
|