buggrep - Bugs: bug #27323, without -i, \s is not respected

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #27323: without -i, \s is not respected

Submitter:  Pierre <pierre>
Submitted:  Wed 26 Aug 2009 02:14:15 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Invalid
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Wed 26 Aug 2009 03:26:43 PM UTC, comment #1: 

i just successed in compiling the cvs version

$> ./grep -V
GNU grep 2.6-cvs

the bug is no more present because \s has no more the meaning of space

Pierre <pierre>
Wed 26 Aug 2009 02:14:15 PM UTC, original submission:  


> 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

Pierre <pierre>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #18645:  allopts added by pierre (242KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by taa (Updated the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-08-27 taa Summarywithout -i, \\s is not respected without -i, \s is not respected
        StatusNone Invalid
        Open/ClosedOpen Closed
    2009-08-26 pierre Attached File- Added allopts, #18645

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code