[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #27323] without -i, \s is not respected
From: |
Pierre |
Subject: |
[bug #27323] without -i, \s is not respected |
Date: |
Wed, 26 Aug 2009 14:14:17 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.13) Gecko/2009080315 Ubuntu/9.04 (jaunty) Firefox/3.0.13 |
URL:
<http://savannah.gnu.org/bugs/?27323>
Summary: without -i, \s is not respected
Project: grep
Submitted by: pierre
Submitted on: mer 26 aoû 2009 14:14:15 GMT
Category: None
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
> grep -V
GNU grep 2.5.3
(i didn't success in compiling the cvs version)
I was wondering which one-letter options exists in grep
$> man grep | grep -E "^\s+-[a-zA-Z][, ]"
-L, --files-without-match
-l, --files-with-matches
it unescapes the s and look for (at least) "s-"
$> man grep | grep -icE "^\s+-[a-zA-Z][, ]"
37
with -i switch, no problem
$> man grep | grep -E "s-"
-L, --files-without-match
-l, --files-with-matches
with bigger files, you know that the resulting regex is not only "s-"
then i've concatened a lot of manpages to test
$> grep -r . /usr/share/man/man* | cut -d" " -f3 > lsman
$> for i in `cat lsman`; do man $i >> allman; done
(this takes a lot of time, i stopped it when allman was 819101 lines, 39
Mib)
$> grep -cE "^\s+-[a-zA-Z][, ]" allman
93
$> grep -icE "^\s+-[a-zA-Z][, ]" allman
9778
$> grep -cE "^ +-[a-zA-Z]+s-[a-zA-Z]" allman
369
(trying to find the regex who will bring to 93)
$> grep -cE "^ +-[a-zA-Z][, ]" allman
9778
a space instead of \s is ok
$> grep -iE "^\s+-[a-zA-Z][, ]" allman | sort -u > allopts
i do that so i can send the file
$> wc -l allopts
4877 allopts
$> grep -cE "^\s+-[a-zA-Z][, ]" allopts
41
so i should grep all lines of allopts, but it takes only 41 (all containing
"s-[a-zA-Z]")
i'm not sure \s is ok to mean space, but why it is working with -i
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: mer 26 aoû 2009 14:14:15 GMT Name: allopts Size: 242 ko By: pierre
<http://savannah.gnu.org/bugs/download.php?file_id=18645>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?27323>
_______________________________________________
Message posté via/par Savannah
http://savannah.gnu.org/
- [bug #27323] without -i, \s is not respected,
Pierre <=