grep command [message #277282] |
Mon, 29 October 2007 06:59 |
gajini
Messages: 262 Registered: January 2006
|
Senior Member |
|
|
Hi,
Please find the output of ls command,
$ls
1.txt
ex.awk
ex1.awk
ex123
num.sh
text.txt
To find the file names that is containing number in it,I used the following command,
$ ls | grep [^0-9]
1.txt
ex.awk
ex1.awk
ex123
num.sh
text.txt
but it's not giving the desired output Why it's so? Please correct if there is any mistake in the grep command to get the desired output...
Thanks..
|
|
|
Re: grep command [message #277284 is a reply to message #277282] |
Mon, 29 October 2007 07:17 |
ThomasG
Messages: 3212 Registered: April 2005 Location: Heilbronn, Germany
|
Senior Member |
|
|
The brackets are a little wrong.
Try
Which means StartsWith[0-9]
[^0-9] evaluates to "contains something else than numbers", I think.
|
|
|
|
|
|