From gd78059@sac.sfbay.sun.com Tue Mar  2 12:55:44 2010
Received: from sunmail2sca.sfbay.sun.com (sunmail2sca.SFBay.Sun.COM [129.145.155.234])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id o22KtiuN016533
	for <psarc-ext@sac.sfbay.sun.com>; Tue, 2 Mar 2010 12:55:44 -0800 (PST)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail2sca.sfbay.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.4) with ESMTP id o22Kth1l022751;
	Tue, 2 Mar 2010 12:55:43 -0800 (PST)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KYO00J0FA4VV200@brm-avmta-1.central.sun.com>; Tue,
 02 Mar 2010 13:55:43 -0700 (MST)
Received: from dm-sfbay-02.sfbay.sun.com ([129.146.11.31])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KYO00LT6A4UFXB0@brm-avmta-1.central.sun.com>; Tue,
 02 Mar 2010 13:55:42 -0700 (MST)
Received: from sac.sfbay.sun.com (sac.SFBay.Sun.COM [129.146.226.132])
	by dm-sfbay-02.sfbay.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.4)
 with ESMTP id o22KtfFQ025026; Tue, 02 Mar 2010 12:55:41 -0800 (PST)
Received: from sac.sfbay.sun.com (localhost [127.0.0.1])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id o22KterJ016528; Tue,
 02 Mar 2010 12:55:40 -0800 (PST)
Received: (from gd78059@localhost)
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8/Submit) id o22KteQ6016524; Tue,
 02 Mar 2010 12:55:40 -0800 (PST)
Date: Tue, 02 Mar 2010 12:55:40 -0800 (PST)
From: "Garrett D'Amore - sun microsystems" <gd78059@sac.sfbay.sun.com>
Subject: xgrep [PSARC/2010/078 FastTrack timeout 03/09/2010]
To: PSARC-ext@sun.com
Cc: ksh93-integration-discuss@opensolaris.org, olga.kryzhanovska@gmail.com
Message-id: <201003022055.o22KteQ6016524@sac.sfbay.sun.com>
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
Status: RO
Content-Length: 6353


Template Version: @(#)sac_nextcase 1.69 02/15/10 SMI
This information is Copyright 2010 Sun Microsystems
1. Introduction
    1.1. Project/Component Working Name:
	 xgrep
    1.2. Name of Document Author/Supplier:
	 Author:  Olga Kyrzhanovska
    1.3  Date of This Document:
	02 March, 2010
4. Technical Description
I'm sponsoring this fast-track request on behalf of the
POSIX utility community and shell project.
Please note that this is an *open* case.

The release binding is the same as with the ksh93 project: a
patch/micro release of Solaris delivering through ON
Stability levels are as described below.


This project is an amendment to the Korn Shell 93 Integration project
(PSARC/2006/550 and PSARC/2007/035, PSARC/2008/094, PSARC/2008/344
and PSARC/2008/589) specifying the following additional
interfaces:
Addition of /usr/bin/xgrep

Bug/RFE Number(s):

6929154  RFE: Add /usr/bin/xgrep (Augmented regular expressions
         (conjunction, negation.))


Interface                    Stability        Description                             
---------                    ---------        -----------  
/usr/bin/xgrep               Committed        xgrep command
ksh93 'xgrep' built in       Committed        xgrep command



Man page for xgrep.1:

========================================================================
NAME
  xgrep - search lines in files for matching augmented regular patterns

SYNOPSIS
  xgrep [ options ] [ pattern ] [ file ... ]

DESCRIPTION
  The xgrep commands search the named input files for lines
  containing a match for the given patterns. Matching lines are
  printed by default. The standard input is searched if no files are
  given or when the file - is specified.

OPTIONS
  -G, --basic-regexp
                  grep mode: basic regular expression
                  patterns.
  -E, --extended-regexp
                  egrep mode: extended regular expression patterns.
  -X, --augmented-regexp
                  xgrep mode (default): augmented regular expression
                  patterns.
  -P, --perl-regexp
                  pgrep mode: perl(1) regular expression patterns.
  -F, --fixed-string
                  fgrep mode: fixed string patterns.
  -C, --context[=before[,after]]
                  Set the matched line context before and after
                  count. By default only matched lines are printed.
                  The option value may be omitted. The default value
                  is 2,2.
  -c, --count     Only print a matching line count for each file.
  -e, --expression|pattern|regexp=pattern
                  Specify a matching pattern. More than one pattern
                  implies alternation. If this option is specified
                  then the command line pattern must be omitted.
  -f, --file=pattern-file
                  Each line in pattern-file is a pattern, placed
                  into a single alternating expression.
  -H, --filename|with-filename
                  Prefix each matched line with the containing file
                  name.
  -h, --no-filename
                  Suppress containing file name prefix for each
                  matched line.
  -i, --ignore-case
                  Ignore case when matching.
  -l, --files-with-matches
                  Only print file names with at least one match.
  -L, --files-without-matches
                  Only print file names with no matches.
  -b, --highlight Highlight matches using the ansi terminal bold
                  sequence.
  -v, --invert-match|revert-match
                  Invert the pattern match sense.
  -m, --label     All patterns must be of the form label:pattern.
                  Match and count output will be prefixed by the
                  corresponding label:.
  -O, --lenient   Enable lenient pattern interpretation. This is the
                  default.
  -x, --line-match|line-regexp
                  Force patterns to match complete lines.
  -n, --number|line-number
                  Prefix each matched line with its line number.
  -N, --name=name Set the standard input file name prefix to name.
                  The default value is empty.
  -q, --quiet|silent
                  Do not print matching lines.
  -S, --strict    Enable strict pattern interpretation with
                  diagnostics.
  -s, --suppress|no-messages
                  Suppress error and warning messages.
  -t, --total     Only print a single matching line count for all
                  files.
  -w, --word-match|word-regexp
                  Force patterns to match complete words.
  -a              Ignored for GNU compatibility.
  --help          Print help message.

DIAGNOSTICS
  Exit status 0 if matches were found, 1 if no matches were found,
  where -v inverts the exit status. Exit status 2 for other errors

ATTRIBUTES
     See attributes(5) for descriptions of the  following  attri-
     butes:

    /usr/bin/xgrep and ksh93 xgrep built in command:
     ____________________________________________________________
    |       ATTRIBUTE TYPE         |       ATTRIBUTE VALUE      |
    |______________________________|____________________________|
    | Availability                 | SUNWcsu                    |
    |______________________________|____________________________|
    | CSI                          | enabled                    |
    |______________________________|____________________________|
    | Interface Stability          | Committed                  |
    |______________________________|____________________________|

  
EXAMPLES
  Negation ('!' NOT operator):
   printf '123\n234\n345\n456\n567\n' | xgrep '^(.*4.*)!$'                          
   
   will print:
   
   123
   567


  Conjunction ('&' AND operator):

   printf '123\n234\n345\n456\n' | xgrep '^(.45)&(34.)$'
  
   will print:
  
   345

CAVEATS
  Some expressions of necessity require exponential space and/or
  time.

BUGS
  Some expressions may use sub-optimal algorithms. For example,
  don't use this implementation to compute primes.

SEE ALSO
  awk(1), ed(1), grep(1), ksh93(1), sed(1), perl(1), regex(3)

========================================================================

6. Resources and Schedule
    6.4. Steering Committee requested information
   	6.4.1. Consolidation C-team Name:
		ON
    6.5. ARC review type: FastTrack
    6.6. ARC Exposure: open


From glenn.skinner@covad.net Tue Mar  2 13:45:05 2010
Received: from newsunmail1brm.central.sun.com (newsunmail1brm.Central.Sun.COM [129.147.62.245])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id o22Lj5Br017206
	for <psarc-ext@sac.sfbay.sun.com>; Tue, 2 Mar 2010 13:45:05 -0800 (PST)
Received: from nwk-avmta-2.sfbay.sun.com (nwk-avmta-2.SFBay.Sun.COM [129.145.155.6])
	by newsunmail1brm.central.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.4) with ESMTP id o22Lj4uZ014838
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Tue, 2 Mar 2010 14:45:05 -0700 (MST)
Received: from pmxchannel-daemon.nwk-avmta-2.sfbay.sun.com by
 nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KYO00G09CF3ZA00@nwk-avmta-2.sfbay.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Tue, 02 Mar 2010 13:45:03 -0800 (PST)
Received: from brmea-mail-4.sun.com ([192.18.98.36])
 by nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KYO00E9DCF21N80@nwk-avmta-2.sfbay.sun.com> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Tue,
 02 Mar 2010 13:45:02 -0800 (PST)
Received: from relay14i.sun.com
 (ip124.net129179-4.block1.us.syntegra.com [129.179.4.124])
	by brmea-mail-4.sun.com (8.13.6+Sun/8.12.9) with ESMTP id o22LZxT4007615	for
 <PSARC-ext@sun.com>; Tue, 02 Mar 2010 21:45:02 +0000 (GMT)
Received: from mmp12es.mmp.us.syntegra.com ([160.41.208.12] [160.41.208.12])
 by relay14i.sun.com with ESMTP id BT-MMP-1499649 for PSARC-ext@sun.com; Tue,
 02 Mar 2010 21:45:01 +0000 (Z)
Received: from relay11i.sun.com (relay11i.sun.com [129.179.4.121])
 by mmp12es.mmp.us.syntegra.com with ESMTP id BT-MMP-34821139 for
 PSARC-ext@sun.com; Tue, 02 Mar 2010 21:45:01 +0000 (Z)
Received: from mail155c8.megamailservers.com
 ([209.235.129.65] [209.235.129.65]) by relay1i.sun.com with ESMTP id
 BT-MMP-22242638 for PSARC-ext@sun.com; Tue, 02 Mar 2010 21:45:01 +0000 (Z)
Received: from [192.168.1.106]
 (h-64-105-36-23.snvacaid.static.covad.net [64.105.36.23])
	by mail155c8.megamailservers.com (8.13.6/8.13.1) with ESMTP id o22LiQm3022132;
 Tue, 02 Mar 2010 16:44:27 -0500
Date: Tue, 02 Mar 2010 13:44:25 -0800
From: Glenn Skinner <glenn.skinner@covad.net>
Subject: Re: 2010/078 [xgrep]
In-reply-to: <201003022055.o22KteQ6016524@sac.sfbay.sun.com>
To: PSARC-ext@sun.com
Cc: ksh93-integration-discuss@opensolaris.org
Message-id: <416161EE-627E-4AA9-A9AC-59AAAD3E4916@covad.net>
MIME-version: 1.0
X-Mailer: Apple Mail (2.936)
Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
X-Brightmail-Tracker: AAAAAA==
X-POP-User: dbclispr@covad.net
X-Antispam: No, score=-2.6/5.0, scanned in 0.113sec at (localhost [127.0.0.1])
	by smf-spamd v1.3.1 - http://smfs.sf.net/
References: <201003022055.o22KteQ6016524@sac.sfbay.sun.com>
Status: RO
Content-Length: 6514

On Mar 2, 2010, at 12:55 PM, Garrett D'Amore - sun microsystems wrote:

> This project is an amendment to the Korn Shell 93 Integration project
> (PSARC/2006/550 and PSARC/2007/035, PSARC/2008/094, PSARC/2008/344
> and PSARC/2008/589) specifying the following additional
> interfaces:
> Addition of /usr/bin/xgrep
>
> Bug/RFE Number(s):
>
> 6929154  RFE: Add /usr/bin/xgrep (Augmented regular expressions
>         (conjunction, negation.))
>
>
> Interface                    Stability        Description
> ---------                    ---------        -----------
> /usr/bin/xgrep               Committed        xgrep command
> ksh93 'xgrep' built in       Committed        xgrep command

Before I give this case my +1, I have some questions:

The case's specification should define the syntax of the regular  
expressions the utility accepts.  I suspect that the variants  
requested by the -E, -F, -G, and -P flags can be handled with  
references to the corresponding man pages.  But what is the  
specification for -X mode REs (including the semantics of alternation  
and conjunction)?

What is the difference between lenient and strict pattern  
interpretation?

What is the default for the -H, -h option pair?  The traditional grep  
utility only prefixes matches with file names when there's more than  
one source file.  Is there a way to request compatibility with that  
behavior?  (I think there should be.)

If conflicting options are given on the command line, which one wins?   
The first, the last, is it an error?

		-- Glenn

> Man page for xgrep.1:
>
> = 
> = 
> ======================================================================
> NAME
>  xgrep - search lines in files for matching augmented regular patterns
>
> SYNOPSIS
>  xgrep [ options ] [ pattern ] [ file ... ]
>
> DESCRIPTION
>  The xgrep commands search the named input files for lines
>  containing a match for the given patterns. Matching lines are
>  printed by default. The standard input is searched if no files are
>  given or when the file - is specified.
>
> OPTIONS
>  -G, --basic-regexp
>                  grep mode: basic regular expression
>                  patterns.
>  -E, --extended-regexp
>                  egrep mode: extended regular expression patterns.
>  -X, --augmented-regexp
>                  xgrep mode (default): augmented regular expression
>                  patterns.
>  -P, --perl-regexp
>                  pgrep mode: perl(1) regular expression patterns.
>  -F, --fixed-string
>                  fgrep mode: fixed string patterns.
>  -C, --context[=before[,after]]
>                  Set the matched line context before and after
>                  count. By default only matched lines are printed.
>                  The option value may be omitted. The default value
>                  is 2,2.
>  -c, --count     Only print a matching line count for each file.
>  -e, --expression|pattern|regexp=pattern
>                  Specify a matching pattern. More than one pattern
>                  implies alternation. If this option is specified
>                  then the command line pattern must be omitted.
>  -f, --file=pattern-file
>                  Each line in pattern-file is a pattern, placed
>                  into a single alternating expression.
>  -H, --filename|with-filename
>                  Prefix each matched line with the containing file
>                  name.
>  -h, --no-filename
>                  Suppress containing file name prefix for each
>                  matched line.
>  -i, --ignore-case
>                  Ignore case when matching.
>  -l, --files-with-matches
>                  Only print file names with at least one match.
>  -L, --files-without-matches
>                  Only print file names with no matches.
>  -b, --highlight Highlight matches using the ansi terminal bold
>                  sequence.
>  -v, --invert-match|revert-match
>                  Invert the pattern match sense.
>  -m, --label     All patterns must be of the form label:pattern.
>                  Match and count output will be prefixed by the
>                  corresponding label:.
>  -O, --lenient   Enable lenient pattern interpretation. This is the
>                  default.
>  -x, --line-match|line-regexp
>                  Force patterns to match complete lines.
>  -n, --number|line-number
>                  Prefix each matched line with its line number.
>  -N, --name=name Set the standard input file name prefix to name.
>                  The default value is empty.
>  -q, --quiet|silent
>                  Do not print matching lines.
>  -S, --strict    Enable strict pattern interpretation with
>                  diagnostics.
>  -s, --suppress|no-messages
>                  Suppress error and warning messages.
>  -t, --total     Only print a single matching line count for all
>                  files.
>  -w, --word-match|word-regexp
>                  Force patterns to match complete words.
>  -a              Ignored for GNU compatibility.
>  --help          Print help message.
>
> DIAGNOSTICS
>  Exit status 0 if matches were found, 1 if no matches were found,
>  where -v inverts the exit status. Exit status 2 for other errors
>
> ATTRIBUTES
>     See attributes(5) for descriptions of the  following  attri-
>     butes:
>
>    /usr/bin/xgrep and ksh93 xgrep built in command:
>     ____________________________________________________________
>    |       ATTRIBUTE TYPE         |       ATTRIBUTE VALUE      |
>    |______________________________|____________________________|
>    | Availability                 | SUNWcsu                    |
>    |______________________________|____________________________|
>    | CSI                          | enabled                    |
>    |______________________________|____________________________|
>    | Interface Stability          | Committed                  |
>    |______________________________|____________________________|
>
>
> EXAMPLES
>  Negation ('!' NOT operator):
>   printf '123\n234\n345\n456\n567\n' | xgrep '^(.*4.*)!$'
>
>   will print:
>
>   123
>   567
>
>
>  Conjunction ('&' AND operator):
>
>   printf '123\n234\n345\n456\n' | xgrep '^(.45)&(34.)$'
>
>   will print:
>
>   345
>
> CAVEATS
>  Some expressions of necessity require exponential space and/or
>  time.
>
> BUGS
>  Some expressions may use sub-optimal algorithms. For example,
>  don't use this implementation to compute primes.
>
> SEE ALSO
>  awk(1), ed(1), grep(1), ksh93(1), sed(1), perl(1), regex(3)



From olga.kryzhanovska@gmail.com Tue Mar  2 14:20:08 2010
Received: from newsunmail1brm.central.sun.com (newsunmail1brm.Central.Sun.COM [129.147.62.245])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id o22MK8YP018446
	for <psarc-ext@sac.sfbay.sun.com>; Tue, 2 Mar 2010 14:20:08 -0800 (PST)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by newsunmail1brm.central.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.4) with ESMTP id o22MK4RK040060
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Tue, 2 Mar 2010 15:20:07 -0700 (MST)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KYO00D27E1I3J00@nwk-avmta-1.sfbay.Sun.COM> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Tue, 02 Mar 2010 14:20:06 -0800 (PST)
Received: from sca-ea-mail-3.sun.com ([192.18.43.21])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KYO00GOSE1HVE40@nwk-avmta-1.sfbay.Sun.COM> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Tue,
 02 Mar 2010 14:20:05 -0800 (PST)
Received: from relay11i.sun.com
 (ip121.net129179-4.block1.us.syntegra.com [129.179.4.121])
	by sca-ea-mail-3.sun.com (8.13.6+Sun/8.12.9) with ESMTP id o22MK5ao008235	for
 <PSARC-ext@sun.com>; Tue, 02 Mar 2010 22:20:05 +0000 (GMT)
Received: from mmp12es.mmp.us.syntegra.com ([160.41.208.12] [160.41.208.12])
 by relay11i.sun.com with ESMTP id BT-MMP-615396 for PSARC-ext@sun.com; Tue,
 02 Mar 2010 22:20:04 +0000 (Z)
Received: from relay15i.sun.com (relay15i.sun.com [129.179.4.125])
 by mmp12es.mmp.us.syntegra.com with ESMTP id BT-MMP-34873464 for
 PSARC-ext@sun.com; Tue, 02 Mar 2010 22:20:04 +0000 (Z)
Received: from mail-bw0-f212.google.com ([209.85.218.212] [209.85.218.212])
 by relay1i.sun.com with ESMTP id BT-MMP-4177806 for PSARC-ext@sun.com; Tue,
 02 Mar 2010 22:20:04 +0000 (Z)
Received: by bwz4 with SMTP id 4so567028bwz.8 for <PSARC-ext@sun.com>; Tue,
 02 Mar 2010 14:20:02 -0800 (PST)
Received: by 10.204.32.72 with SMTP id b8mr5068461bkd.203.1267568398688; Tue,
 02 Mar 2010 14:19:58 -0800 (PST)
Date: Tue, 02 Mar 2010 23:19:58 +0100
From: =?KOI8-R?B?z8zYx8Egy9LZ1sHOz9fTy8HR?= <olga.kryzhanovska@gmail.com>
Subject: Re: 2010/078 [xgrep]
In-reply-to: <416161EE-627E-4AA9-A9AC-59AAAD3E4916@covad.net>
To: Glenn Skinner <glenn.skinner@covad.net>
Cc: PSARC-ext@sun.com, ksh93-integration-discuss@opensolaris.org,
        Glenn Fowler <gsf@research.att.com>
Message-id: <e21eff1d1003021419r2bfad739kb2d6f5aff87a801@mail.gmail.com>
MIME-version: 1.0
Content-type: text/plain; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=gmail.com;
 s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references
 :date:message-id:subject:from:to:cc:content-type;
 bh=k68QN/Qsh7eamiFtrPUg7p2/o6NKgAjTOlie6pf6/JE=;
 b=vg2L4flqvK/FQKxjXNVWaF6peK0GI/stKxF3MQLwWMUoqn15xCfSJVbRm8Jun9Fnuw
 KspQspmuX0163IGHu984laaBJAQDrA6vOEFLmjE+YCoqx5e6cqGxP+faCVCzl2WUkvmd
 crg9+ut5mrcrEtc5q0VQuQ6SBzaE3lASqD0tU=
DomainKey-Signature: a=rsa-sha1; c=nofws;        d=gmail.com; s=gamma;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :cc:content-type;
 b=mC5tBENwKJ2iftFFTyhp098AldB1XJ2HsEH7hhvYqsLgvYeLkNStskUbnLO4X6d900
 GsDV0dSi7XT/0NbuQPAS2/VAQnA1HUWBsG+N2Lz5wkI7J4kcAEJR+wzll7oegpy2i2pp
 GTUdSLjLxlxbjRHCRLxUkm44qPwNCaXTSeLlk=
X-PMX-Version: 5.4.1.325704
X-Brightmail-Tracker: AAAAAA==
X-Antispam: No, score=-2.6/5.0, scanned in 0.070sec at (localhost [127.0.0.1])
	by smf-spamd v1.3.1 - http://smfs.sf.net/
References: <201003022055.o22KteQ6016524@sac.sfbay.sun.com>
 <416161EE-627E-4AA9-A9AC-59AAAD3E4916@covad.net>
Status: RO
Content-Length: 2345

On Tue, Mar 2, 2010 at 10:44 PM, Glenn Skinner <glenn.skinner@covad.net> wrote:
> On Mar 2, 2010, at 12:55 PM, Garrett D'Amore - sun microsystems wrote:
>
>> This project is an amendment to the Korn Shell 93 Integration project
>> (PSARC/2006/550 and PSARC/2007/035, PSARC/2008/094, PSARC/2008/344
>> and PSARC/2008/589) specifying the following additional
>> interfaces:
>> Addition of /usr/bin/xgrep
>>
>> Bug/RFE Number(s):
>>
>> 6929154  RFE: Add /usr/bin/xgrep (Augmented regular expressions
>>        (conjunction, negation.))
>>
>>
>> Interface                    Stability        Description
>> ---------                    ---------        -----------
>> /usr/bin/xgrep               Committed        xgrep command
>> ksh93 'xgrep' built in       Committed        xgrep command
>
> Before I give this case my +1, I have some questions:
>
> The case's specification should define the syntax of the regular expressions
> the utility accepts.  I suspect that the variants requested by the -E, -F,
> -G, and -P flags can be handled with references to the corresponding man
> pages.  But what is the specification for -X mode REs (including the
> semantics of alternation and conjunction)?

-X is like POSIX grep -E (egrep) but adds & as AND operator and ! as
NOT operator.

>
> What is the difference between lenient and strict pattern interpretation?

Strict will print syntax errors if the pattern does not match the
standard exactly. I leave the exact explanation to Glenn Fowler.

> What is the default for the -H, -h option pair?  The traditional grep
> utility only prefixes matches with file names when there's more than one
> source file.  Is there a way to request compatibility with that behavior?
>  (I think there should be.)

This is already the default.

Try:
builtin xgrep
xgrep ksh /etc/profile /etc/profile

> If conflicting options are given on the command line, which one wins?  The
> first, the last, is it an error?

Should be an error unless POSIX defines it else for this option.

Olga
-- 
      ,   _                                    _   ,
     { \/`o;====-    Olga Kryzhanovska   -====;o`\/ }
.----'-/`-/     olga.kryzhanovska@gmail.com   \-`\-'----.
 `'-..-| /     Solaris/BSD//C/C++ programmer   \ |-..-'`
      /\/\                                     /\/\
      `--`                                      `--`

From olga.kryzhanovska@gmail.com Thu Mar  4 23:46:16 2010
Received: from sunmail3mpk.sfbay.sun.com (sunmail3mpk.SFBay.Sun.COM [129.146.11.52])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id o257kGjb029139
	for <psarc-ext@sac.sfbay.sun.com>; Thu, 4 Mar 2010 23:46:16 -0800 (PST)
Received: from nwk-avmta-2.sfbay.sun.com (nwk-avmta-2.SFBay.Sun.COM [129.145.155.6])
	by sunmail3mpk.sfbay.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.4) with ESMTP id o257kEAk004221;
	Thu, 4 Mar 2010 23:46:16 -0800 (PST)
Received: from pmxchannel-daemon.nwk-avmta-2.sfbay.sun.com by
 nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KYS00E1NTL4DQ00@nwk-avmta-2.sfbay.sun.com>; Thu,
 04 Mar 2010 23:46:16 -0800 (PST)
Received: from sca-ea-mail-2.sun.com ([192.18.43.25])
 by nwk-avmta-2.sfbay.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KYS004MTTL30490@nwk-avmta-2.sfbay.sun.com>; Thu,
 04 Mar 2010 23:46:15 -0800 (PST)
Received: from relay41i.sun.com ([192.5.209.70])
	by sca-ea-mail-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id o257hlhA026734;
 Fri, 05 Mar 2010 07:46:15 +0000 (GMT)
Received: from mms49es.mms.us.syntegra.com ([160.41.221.232] [160.41.221.232])
 by relay41i.sun.com with ESMTP id BT-MMP-1656914; Fri,
 05 Mar 2010 07:46:12 +0000 (Z)
Received: from relay41i.sun.com (relay41i.sun.com [192.5.209.70])
 by mms49es.mms.us.syntegra.com with ESMTP id BT-MMP-24785147; Fri,
 05 Mar 2010 07:46:12 +0000 (Z)
Received: from mail-fx0-f227.google.com ([209.85.220.227] [209.85.220.227])
 by relay4i.sun.com with ESMTP id BT-MMP-41913646; Fri,
 05 Mar 2010 07:46:11 +0000 (Z)
Received: by fxm27 with SMTP id 27so3825242fxm.8 for <multiple recipients>;
 Thu, 04 Mar 2010 23:45:21 -0800 (PST)
Received: by 10.223.60.138 with SMTP id p10mr608913fah.32.1267775116313; Thu,
 04 Mar 2010 23:45:16 -0800 (PST)
Date: Fri, 05 Mar 2010 08:45:16 +0100
From: =?KOI8-R?B?z8zYx8Egy9LZ1sHOz9fTy8HR?= <olga.kryzhanovska@gmail.com>
Subject: Re: 2010/078 [xgrep]
In-reply-to: <e21eff1d1003021419r2bfad739kb2d6f5aff87a801@mail.gmail.com>
To: Glenn Skinner <glenn.skinner@covad.net>
Cc: PSARC-ext@sun.com, ksh93-integration-discuss@opensolaris.org,
        Glenn Fowler <gsf@research.att.com>,
        "Garrett D'Amore" <gdamore@sun.com>
Message-id: <e21eff1d1003042345s27d267eal10099501ca036cd0@mail.gmail.com>
MIME-version: 1.0
Content-type: text/plain; charset=KOI8-R
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=gmail.com;
 s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references
 :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding;
 bh=VvajJDCUZ+Bs49X/w88fUdNTALIIy+M3tJ9DMBVYc+4=;
 b=TTu83G+t08i3m73p2GOT0/5Wj56bw2AtagjczvgW4CBcj/LKmIqZJzHgwfYrTpfKq8
 qp3V9MdiivKdFp6NiSVZRvhVWTwGh+2hvE9K0HDg7lSbHIhlHgGglpHMMMiylvY5Kb0X
 SwZ2fBwjpRmmHBOo3+sUQT6vdVorcNiUUw/oI=
DomainKey-Signature: a=rsa-sha1; c=nofws;        d=gmail.com; s=gamma;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :cc:content-type:content-transfer-encoding;
 b=ZL8VyhMYjLHHWHqG7MDXkY1vtQ1qUYc1l429D/l5DNB/FTUKX63o8Ph9RuIYQ+Ij8d
 z10Ii2D3XdUo8xu86SqVjkYCYsSwSINsi2YjuQ2soPn76uDFP6aYUZkJO7al1AR9G5Av
 u/EPqadL0LPrCwu8LXsxVlpvtg4aGxlkqbZqA=
X-PMX-Version: 5.4.1.325704
X-Brightmail-Tracker: AAAAAA==
X-Antispam: No, score=-2.6/5.0, scanned in 0.077sec at (localhost [127.0.0.1])
	by smf-spamd v1.3.1 - http://smfs.sf.net/
References: <201003022055.o22KteQ6016524@sac.sfbay.sun.com>
 <416161EE-627E-4AA9-A9AC-59AAAD3E4916@covad.net>
 <e21eff1d1003021419r2bfad739kb2d6f5aff87a801@mail.gmail.com>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by sac.sfbay.sun.com id o257kGjb029139
Status: RO
Content-Length: 2889

2010/3/2 ольга крыжановская <olga.kryzhanovska@gmail.com>:
> On Tue, Mar 2, 2010 at 10:44 PM, Glenn Skinner <glenn.skinner@covad.net> wrote:
>> On Mar 2, 2010, at 12:55 PM, Garrett D'Amore - sun microsystems wrote:
>>
>>> This project is an amendment to the Korn Shell 93 Integration project
>>> (PSARC/2006/550 and PSARC/2007/035, PSARC/2008/094, PSARC/2008/344
>>> and PSARC/2008/589) specifying the following additional
>>> interfaces:
>>> Addition of /usr/bin/xgrep
>>>
>>> Bug/RFE Number(s):
>>>
>>> 6929154  RFE: Add /usr/bin/xgrep (Augmented regular expressions
>>>        (conjunction, negation.))
>>>
>>>
>>> Interface                    Stability        Description
>>> ---------                    ---------        -----------
>>> /usr/bin/xgrep               Committed        xgrep command
>>> ksh93 'xgrep' built in       Committed        xgrep command
>>
>> Before I give this case my +1, I have some questions:
>>
>> The case's specification should define the syntax of the regular expressions
>> the utility accepts.  I suspect that the variants requested by the -E, -F,
>> -G, and -P flags can be handled with references to the corresponding man
>> pages.  But what is the specification for -X mode REs (including the
>> semantics of alternation and conjunction)?
>
> -X is like POSIX grep -E (egrep) but adds & as AND operator and ! as
> NOT operator.
>
>>
>> What is the difference between lenient and strict pattern interpretation?
>
> Strict will print syntax errors if the pattern does not match the
> standard exactly. I leave the exact explanation to Glenn Fowler.

Glenn's replied this:
--------------------------------
-O, --lenient sets the regcomp(3) REG_LENIENT flag
in general if REG_LENIENT is on then certain constructs marked
"unspecified" in the standard will be accepted, otherwise they
may produce regcomp(3) errors

e.g.

invalid \char escape

       grep -S '\#' <<<'#'

invalid [...] range endpoint

       grep -S '[a-q-z]' <<<'a'

the intention (theory) is that RE's that make it through -S, --strict
will make it through all conformant implementations

as counterexamples roll in I tweak libast/reg*.c to make pratice match theory
--------------------------------

'lenient' mode by default may be an option (i.e. look at Garrett
D'Amore proposal for moving /usr/xpg4/bin to /usr/bin, AST grep would
keep strong backwards compatibility sans the dreaded i18n bugs in the
current /usr/bin/grep) if we replace /usr/bin/grep and friends with
this grep implementation and use 'strict' mode for /usr/xpg4/bin/grep.

Olga
-- 
      ,   _                                    _   ,
     { \/`o;====-    Olga Kryzhanovska   -====;o`\/ }
.----'-/`-/     olga.kryzhanovska@gmail.com   \-`\-'----.
 `'-..-| /     Solaris/BSD//C/C++ programmer   \ |-..-'`
      /\/\                                     /\/\
      `--`                                      `--`


From iszczesniak@gmail.com Sun Mar  7 10:58:34 2010
Received: from sunmail3mpk.sfbay.sun.com (sunmail3mpk.SFBay.Sun.COM [129.146.11.52])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id o27IwYTA002308
	for <psarc-ext@sac.sfbay.sun.com>; Sun, 7 Mar 2010 10:58:34 -0800 (PST)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail3mpk.sfbay.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.4) with ESMTP id o27IwXIA003446
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Sun, 7 Mar 2010 10:58:34 -0800 (PST)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KYX00H01E1L8L00@brm-avmta-1.central.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Sun, 07 Mar 2010 11:58:33 -0700 (MST)
Received: from brmea-mail-2.sun.com ([192.18.98.43])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KYX00G21E1LNU10@brm-avmta-1.central.sun.com> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Sun,
 07 Mar 2010 11:58:33 -0700 (MST)
Received: from relay14i.sun.com
 (ip124.net129179-4.block1.us.syntegra.com [129.179.4.124])
	by brmea-mail-2.sun.com (8.13.6+Sun/8.12.9) with ESMTP id o27IwW4P008891	for
 <PSARC-ext@sun.com>; Sun, 07 Mar 2010 18:58:33 +0000 (GMT)
Received: from mmp11es.mmp.us.syntegra.com ([160.41.208.11] [160.41.208.11])
 by relay14i.sun.com with ESMTP id BT-MMP-1835315 for PSARC-ext@sun.com; Sun,
 07 Mar 2010 18:58:32 +0000 (Z)
Received: from relay13i.sun.com (relay13i.sun.com [129.179.4.123])
 by mmp11es.mmp.us.syntegra.com with ESMTP id BT-MMP-46325304 for
 PSARC-ext@sun.com; Sun, 07 Mar 2010 18:58:32 +0000 (Z)
Received: from mail-bw0-f214.google.com ([209.85.218.214] [209.85.218.214])
 by relay1i.sun.com with ESMTP id BT-MMP-15259541 for PSARC-ext@sun.com; Sun,
 07 Mar 2010 18:58:32 +0000 (Z)
Received: by bwz6 with SMTP id 6so1959095bwz.16 for <PSARC-ext@sun.com>; Sun,
 07 Mar 2010 10:58:29 -0800 (PST)
Received: by 10.204.134.211 with SMTP id k19mr3680829bkt.56.1267988308819; Sun,
 07 Mar 2010 10:58:28 -0800 (PST)
Date: Sun, 07 Mar 2010 19:58:28 +0100
From: "I. Szczesniak" <iszczesniak@gmail.com>
Subject: Re: [ksh93-integration-discuss] xgrep [PSARC/2010/078 FastTrack
	timeout 03/09/2010]
In-reply-to: <201003022055.o22KteQ6016524@sac.sfbay.sun.com>
To: Korn Shell 93 integration/migration project discussion
 <ksh93-integration-discuss@opensolaris.org>,
        =?KOI8-R?B?z8zYx8Egy9LZ1sHOz9fTy8HR?= <olga.kryzhanovska@gmail.com>
Cc: PSARC-ext@sun.com
Message-id: <cd45720b1003071058v47eef15x96cc64a4ff4ef353@mail.gmail.com>
MIME-version: 1.0
Content-type: text/plain; charset=ISO-8859-1
Content-transfer-encoding: 7BIT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=gmail.com;
 s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references
 :date:message-id:subject:from:to:cc:content-type;
 bh=zZ+pKYmby5lcTDGXFWasNG77H4WHuLEeMDUPtRNG6LE=;
 b=oDt9jNeTPeJM7SoedFpCgqINRSRGRnJYzjuWDM2GkFVf/e/1z2yDy2XBVBfjG3LBkF
 DJxrrysJhqfgkRs6WKQ+sT6OU8FSf3YJN0rtoFrh2nrhoti4iJXFkiAnjBQfvJa4VqRm
 9RfNR9e/Rmc5rNfxwlJRB0xzMKIdlK2PVRHqk=
DomainKey-Signature: a=rsa-sha1; c=nofws;        d=gmail.com; s=gamma;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :cc:content-type;
 b=katNk5NBIWxu6AtnBD4IKgtCxrq6dN+uXmcbrCW+ewRQQs2AJL8dTbrMq5z6yX9G0H
 gsu2hIvTqb57Y4sq9Rkmbv/a8h26TMn+YZR54gsRGmKVNwp3+BCGPIJQeXw1t1C/NrWu
 NBZ/dY6m6B1pGlxhvw/vkJNcQ/RWf7K42TceU=
X-PMX-Version: 5.4.1.325704
X-Brightmail-Tracker: AAAAAA==
X-Antispam: No, score=-2.6/5.0, scanned in 0.106sec at (localhost [127.0.0.1])
	by smf-spamd v1.3.1 - http://smfs.sf.net/
References: <201003022055.o22KteQ6016524@sac.sfbay.sun.com>
Status: RO
Content-Length: 6423

Olga, please check my comments inline:

On Tue, Mar 2, 2010 at 9:55 PM, Garrett  D'Amore - sun microsystems
<gd78059@sac.sfbay.sun.com> wrote:
>
> Template Version: @(#)sac_nextcase 1.69 02/15/10 SMI
> This information is Copyright 2010 Sun Microsystems
> 1. Introduction
>    1.1. Project/Component Working Name:
>         xgrep
>    1.2. Name of Document Author/Supplier:
>         Author:  Olga Kyrzhanovska
>    1.3  Date of This Document:
>        02 March, 2010
> 4. Technical Description
> I'm sponsoring this fast-track request on behalf of the
> POSIX utility community and shell project.
> Please note that this is an *open* case.
>
> The release binding is the same as with the ksh93 project: a
> patch/micro release of Solaris delivering through ON
> Stability levels are as described below.
>
>
> This project is an amendment to the Korn Shell 93 Integration project
> (PSARC/2006/550 and PSARC/2007/035, PSARC/2008/094, PSARC/2008/344
> and PSARC/2008/589) specifying the following additional
> interfaces:
> Addition of /usr/bin/xgrep
>
> Bug/RFE Number(s):
>
> 6929154  RFE: Add /usr/bin/xgrep (Augmented regular expressions
>         (conjunction, negation.))
>
>
> Interface                    Stability        Description
> ---------                    ---------        -----------
> /usr/bin/xgrep               Committed        xgrep command
> ksh93 'xgrep' built in       Committed        xgrep command
>
>
>
> Man page for xgrep.1:
>
> ========================================================================
> NAME
>  xgrep - search lines in files for matching augmented regular patterns
>
> SYNOPSIS
>  xgrep [ options ] [ pattern ] [ file ... ]
>
> DESCRIPTION
>  The xgrep commands search the named input files for lines
>  containing a match for the given patterns. Matching lines are
>  printed by default. The standard input is searched if no files are
>  given or when the file - is specified.
>
> OPTIONS
>  -G, --basic-regexp
>                  grep mode: basic regular expression
>                  patterns.
>  -E, --extended-regexp
>                  egrep mode: extended regular expression patterns.
>  -X, --augmented-regexp
>                  xgrep mode (default): augmented regular expression
>                  patterns.
>  -P, --perl-regexp
>                  pgrep mode: perl(1) regular expression patterns.
>  -F, --fixed-string
>                  fgrep mode: fixed string patterns.
>  -C, --context[=before[,after]]
>                  Set the matched line context before and after
>                  count. By default only matched lines are printed.
>                  The option value may be omitted. The default value
>                  is 2,2.
>  -c, --count     Only print a matching line count for each file.
>  -e, --expression|pattern|regexp=pattern
>                  Specify a matching pattern. More than one pattern
>                  implies alternation. If this option is specified
>                  then the command line pattern must be omitted.
>  -f, --file=pattern-file
>                  Each line in pattern-file is a pattern, placed
>                  into a single alternating expression.
>  -H, --filename|with-filename
>                  Prefix each matched line with the containing file
>                  name.
>  -h, --no-filename
>                  Suppress containing file name prefix for each
>                  matched line.
>  -i, --ignore-case
>                  Ignore case when matching.
>  -l, --files-with-matches
>                  Only print file names with at least one match.
>  -L, --files-without-matches
>                  Only print file names with no matches.
>  -b, --highlight Highlight matches using the ansi terminal bold
>                  sequence.
>  -v, --invert-match|revert-match
>                  Invert the pattern match sense.
>  -m, --label     All patterns must be of the form label:pattern.
>                  Match and count output will be prefixed by the
>                  corresponding label:.
>  -O, --lenient   Enable lenient pattern interpretation. This is the
>                  default.
>  -x, --line-match|line-regexp
>                  Force patterns to match complete lines.
>  -n, --number|line-number
>                  Prefix each matched line with its line number.
>  -N, --name=name Set the standard input file name prefix to name.
>                  The default value is empty.
>  -q, --quiet|silent
>                  Do not print matching lines.
>  -S, --strict    Enable strict pattern interpretation with
>                  diagnostics.
>  -s, --suppress|no-messages
>                  Suppress error and warning messages.
>  -t, --total     Only print a single matching line count for all
>                  files.
>  -w, --word-match|word-regexp
>                  Force patterns to match complete words.
>  -a              Ignored for GNU compatibility.
>  --help          Print help message.

--version is missing.

> DIAGNOSTICS
>  Exit status 0 if matches were found, 1 if no matches were found,
>  where -v inverts the exit status. Exit status 2 for other errors
>
> ATTRIBUTES
>     See attributes(5) for descriptions of the  following  attri-
>     butes:
>
>    /usr/bin/xgrep and ksh93 xgrep built in command:
>     ____________________________________________________________
>    |       ATTRIBUTE TYPE         |       ATTRIBUTE VALUE      |
>    |______________________________|____________________________|
>    | Availability                 | SUNWcsu                    |
>    |______________________________|____________________________|
>    | CSI                          | enabled                    |
>    |______________________________|____________________________|
>    | Interface Stability          | Committed                  |
>    |______________________________|____________________________|

Are you sure you want this all as Committed? If I understood Roland
right he said that options should only be Committed if they fall into
one or more of these categories and Uncommitted otherwise:
- The option is defined by the SUS or POSIX standard
- More than two implementations provide this option
- The option has been around for many years

xgrep is not a utility defined by POSIX or SUS but grep is and I see
this case as first step towards a modernisation of /usr/bin/grep,
/usr/bin/xpg4/bin/grep and cohorts (I see you already have the code
integrated).

Irek

From gdamore@sun.com Sun Mar  7 20:47:28 2010
Received: from sunmail6brm.central.sun.com (sunmail6brm.Central.Sun.COM [129.147.4.169])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id o284lSbs007758
	for <psarc-ext@sac.sfbay.sun.com>; Sun, 7 Mar 2010 20:47:28 -0800 (PST)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail6brm.central.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.4) with ESMTP id o284lReK018843
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Sun, 7 Mar 2010 22:47:28 -0600 (CST)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KYY002035B4YM00@nwk-avmta-1.sfbay.Sun.COM> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Sun, 07 Mar 2010 20:47:28 -0800 (PST)
Received: from sca-es-mail-1.sun.com ([192.18.43.132])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KYY0023N5B3ZG80@nwk-avmta-1.sfbay.Sun.COM> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Sun,
 07 Mar 2010 20:47:27 -0800 (PST)
Received: from fe-sfbay-10.sun.com ([192.18.43.129])
	by sca-es-mail-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id o284lRXi007789	for
 <PSARC-ext@sun.com>; Sun, 07 Mar 2010 20:47:27 -0800 (PST)
Received: from conversion-daemon.fe-sfbay-10.sun.com by fe-sfbay-10.sun.com
 (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul  2 2009))
 id <0KYY00M00569AL00@fe-sfbay-10.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Sun, 07 Mar 2010 20:47:27 -0800 (PST)
Received: from [192.168.251.11] ([unknown] [76.93.15.33])
 by fe-sfbay-10.sun.com
 (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul  2 2009))
 with ESMTPSA id <0KYY00FSH5B3QQC0@fe-sfbay-10.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Sun, 07 Mar 2010 20:47:27 -0800 (PST)
Date: Sun, 07 Mar 2010 20:47:27 -0800
From: "Garrett D'Amore" <gdamore@sun.com>
Subject: Re: [ksh93-integration-discuss] xgrep [PSARC/2010/078 FastTrack
	timeout 03/09/2010]
In-reply-to: <cd45720b1003071058v47eef15x96cc64a4ff4ef353@mail.gmail.com>
Sender: Garrett.Damore@sun.com
To: "I. Szczesniak" <iszczesniak@gmail.com>
Cc: Korn Shell 93 integration/migration project discussion
 <ksh93-integration-discuss@opensolaris.org>,
        =?UTF-8?B?0L7Qu9GM0LPQsCDQutGA0YvQttCw0L3QvtCy0YHQutCw0Y8=?=
 <olga.kryzhanovska@gmail.com>,
        PSARC-ext@sun.com
Message-id: <4B94815F.6060204@sun.com>
MIME-version: 1.0
Content-type: text/plain; CHARSET=US-ASCII; format=flowed
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
References: <201003022055.o22KteQ6016524@sac.sfbay.sun.com>
 <cd45720b1003071058v47eef15x96cc64a4ff4ef353@mail.gmail.com>
User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.1.5) Gecko/20100117
 Lightning/1.0b1 Thunderbird/3.0
Status: RO
Content-Length: 1044


> Are you sure you want this all as Committed? If I understood Roland
> right he said that options should only be Committed if they fall into
> one or more of these categories and Uncommitted otherwise:
> - The option is defined by the SUS or POSIX standard
> - More than two implementations provide this option
> - The option has been around for many years
>
> xgrep is not a utility defined by POSIX or SUS but grep is and I see
> this case as first step towards a modernisation of /usr/bin/grep,
> /usr/bin/xpg4/bin/grep and cohorts (I see you already have the code
> integrated).
>    

I think you may be confusing "Committed" with "Standard".  Committed has 
none of those requirements, but merely implies a "commitment" to keep 
the interface around (allowing for upwardly compatible changes) for the 
foreseeable future.

If there are plans to change the interface, or if it has gotten so 
little exposure that you're not sure if you might want to make 
incompatible changes in the future, then Uncommitted is better.

     - Garrett


From olga.kryzhanovska@gmail.com Wed Mar 17 09:10:49 2010
Received: from sunmail2sca.sfbay.sun.com (sunmail2sca.SFBay.Sun.COM [129.145.155.234])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id o2HGAndx011866
	for <psarc-ext@sac.sfbay.sun.com>; Wed, 17 Mar 2010 09:10:49 -0700 (PDT)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail2sca.sfbay.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.4) with ESMTP id o2HGAlMW002413;
	Wed, 17 Mar 2010 09:10:49 -0700 (PDT)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KZF00I0LOY03500@brm-avmta-1.central.sun.com>; Wed,
 17 Mar 2010 10:10:48 -0600 (MDT)
Received: from sca-ea-mail-2.sun.com ([192.18.43.25])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KZF00CI3OXS7340@brm-avmta-1.central.sun.com>; Wed,
 17 Mar 2010 10:10:48 -0600 (MDT)
Received: from relay15i.sun.com
 (ip125.net129179-4.block1.us.syntegra.com [129.179.4.125])
	by sca-ea-mail-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id o2HG2rPI012251;
 Wed, 17 Mar 2010 16:10:39 +0000 (GMT)
Received: from mmp12es.mmp.us.syntegra.com ([160.41.208.12] [160.41.208.12])
 by relay15i.sun.com with ESMTP id BT-MMP-2534206; Wed,
 17 Mar 2010 16:10:39 +0000 (Z)
Received: from relay13i.sun.com (relay13i.sun.com [129.179.4.123])
 by mmp12es.mmp.us.syntegra.com with ESMTP id BT-MMP-69029646; Wed,
 17 Mar 2010 16:10:39 +0000 (Z)
Received: from mail-bw0-f228.google.com ([209.85.218.228] [209.85.218.228])
 by relay1i.sun.com with ESMTP id BT-MMP-1239686; Wed,
 17 Mar 2010 16:10:39 +0000 (Z)
Received: by mail-bw0-f228.google.com with SMTP id 28so1396709bwz.34 for
 <multiple recipients>; Wed, 17 Mar 2010 09:10:30 -0700 (PDT)
Received: by 10.204.25.70 with SMTP id y6mr1389752bkb.130.1268842229851; Wed,
 17 Mar 2010 09:10:29 -0700 (PDT)
Date: Wed, 17 Mar 2010 17:10:29 +0100
From: =?KOI8-R?B?z8zYx8Egy9LZ1sHOz9fTy8HR?= <olga.kryzhanovska@gmail.com>
Subject: Re: 2010/078 [xgrep]
In-reply-to: <e21eff1d1003042345s27d267eal10099501ca036cd0@mail.gmail.com>
To: Glenn Skinner <glenn.skinner@covad.net>
Cc: PSARC-ext@sun.com, ksh93-integration-discuss@opensolaris.org,
        Glenn Fowler <gsf@research.att.com>,
        "Garrett D'Amore" <gdamore@sun.com>
Message-id: <e21eff1d1003170910m6f928bc8sc38df9159c81ba9f@mail.gmail.com>
MIME-version: 1.0
Content-type: text/plain; charset=KOI8-R
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=gmail.com;
 s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references
 :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding;
 bh=rztQWHrnoDLzHV8/dnE51BW45/6V7Ajh9ebpXowK2YI=;
 b=DQlzehf3yEnp+LHJ1oOzGQgqndUvMz/fdWvzI847vCzzWnUzyeACB6tRxk8TH9Tain
 V1cPMpBAdVphzXYtEaPS6eI31aowbWSex5O8j8pq60zR9fBZkL2cVyVV0T+XrUV8Z2YZ
 5lbrWWyBFqYLhVtJVA7keQuVnDNR7kmHBzZ7U=
DomainKey-Signature: a=rsa-sha1; c=nofws;        d=gmail.com; s=gamma;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :cc:content-type:content-transfer-encoding;
 b=mD1pQbGjgXBgCP5uyUiV/3z9G0vRiB9JgLymMvUgu3fe7Nw8+Zw6xmASME4K3LBRIn
 vzEN8UNifiK1ZRLgB0gXnmyJR4OruAdOpdmPrv9cjspvmMMpMGIxNgdgQlp5/BJ8N9vk
 diAjK1dW8UiZTymodYt951RgCn+x9Iz9R4RTQ=
X-PMX-Version: 5.4.1.325704
X-Brightmail-Tracker: AAAAAA==
X-Antispam: No, score=-2.6/5.0, scanned in 0.081sec at (localhost [127.0.0.1])
	by smf-spamd v1.3.1 - http://smfs.sf.net/
References: <201003022055.o22KteQ6016524@sac.sfbay.sun.com>
 <416161EE-627E-4AA9-A9AC-59AAAD3E4916@covad.net>
 <e21eff1d1003021419r2bfad739kb2d6f5aff87a801@mail.gmail.com>
 <e21eff1d1003042345s27d267eal10099501ca036cd0@mail.gmail.com>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by sac.sfbay.sun.com id o2HGAndx011866
Status: RO
Content-Length: 3415

Is this case now approved?

Olga

2010/3/5 ольга крыжановская <olga.kryzhanovska@gmail.com>:
> 2010/3/2 ольга крыжановская <olga.kryzhanovska@gmail.com>:
>> On Tue, Mar 2, 2010 at 10:44 PM, Glenn Skinner <glenn.skinner@covad.net> wrote:
>>> On Mar 2, 2010, at 12:55 PM, Garrett D'Amore - sun microsystems wrote:
>>>
>>>> This project is an amendment to the Korn Shell 93 Integration project
>>>> (PSARC/2006/550 and PSARC/2007/035, PSARC/2008/094, PSARC/2008/344
>>>> and PSARC/2008/589) specifying the following additional
>>>> interfaces:
>>>> Addition of /usr/bin/xgrep
>>>>
>>>> Bug/RFE Number(s):
>>>>
>>>> 6929154  RFE: Add /usr/bin/xgrep (Augmented regular expressions
>>>>        (conjunction, negation.))
>>>>
>>>>
>>>> Interface                    Stability        Description
>>>> ---------                    ---------        -----------
>>>> /usr/bin/xgrep               Committed        xgrep command
>>>> ksh93 'xgrep' built in       Committed        xgrep command
>>>
>>> Before I give this case my +1, I have some questions:
>>>
>>> The case's specification should define the syntax of the regular expressions
>>> the utility accepts.  I suspect that the variants requested by the -E, -F,
>>> -G, and -P flags can be handled with references to the corresponding man
>>> pages.  But what is the specification for -X mode REs (including the
>>> semantics of alternation and conjunction)?
>>
>> -X is like POSIX grep -E (egrep) but adds & as AND operator and ! as
>> NOT operator.
>>
>>>
>>> What is the difference between lenient and strict pattern interpretation?
>>
>> Strict will print syntax errors if the pattern does not match the
>> standard exactly. I leave the exact explanation to Glenn Fowler.
>
> Glenn's replied this:
> --------------------------------
> -O, --lenient sets the regcomp(3) REG_LENIENT flag
> in general if REG_LENIENT is on then certain constructs marked
> "unspecified" in the standard will be accepted, otherwise they
> may produce regcomp(3) errors
>
> e.g.
>
> invalid \char escape
>
>       grep -S '\#' <<<'#'
>
> invalid [...] range endpoint
>
>       grep -S '[a-q-z]' <<<'a'
>
> the intention (theory) is that RE's that make it through -S, --strict
> will make it through all conformant implementations
>
> as counterexamples roll in I tweak libast/reg*.c to make pratice match theory
> --------------------------------
>
> 'lenient' mode by default may be an option (i.e. look at Garrett
> D'Amore proposal for moving /usr/xpg4/bin to /usr/bin, AST grep would
> keep strong backwards compatibility sans the dreaded i18n bugs in the
> current /usr/bin/grep) if we replace /usr/bin/grep and friends with
> this grep implementation and use 'strict' mode for /usr/xpg4/bin/grep.
>
> Olga
> --
>      ,   _                                    _   ,
>     { \/`o;====-    Olga Kryzhanovska   -====;o`\/ }
> .----'-/`-/     olga.kryzhanovska@gmail.com   \-`\-'----.
>  `'-..-| /     Solaris/BSD//C/C++ programmer   \ |-..-'`
>      /\/\                                     /\/\
>      `--`                                      `--`
>



-- 
      ,   _                                    _   ,
     { \/`o;====-    Olga Kryzhanovska   -====;o`\/ }
.----'-/`-/     olga.kryzhanovska@gmail.com   \-`\-'----.
 `'-..-| /     Solaris/BSD//C/C++ programmer   \ |-..-'`
      /\/\                                     /\/\
      `--`                                      `--`


From gdamore@sun.com Wed Mar 17 09:29:03 2010
Received: from sunmail6brm.central.sun.com (sunmail6brm.Central.Sun.COM [129.147.4.169])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id o2HGT2hX012278
	for <psarc-ext@sac.sfbay.sun.com>; Wed, 17 Mar 2010 09:29:02 -0700 (PDT)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by sunmail6brm.central.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.4) with ESMTP id o2HGT18b005587
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Wed, 17 Mar 2010 11:29:02 -0500 (CDT)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KZF00J0VPSERR00@brm-avmta-1.central.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@SUN.COM); Wed, 17 Mar 2010 10:29:02 -0600 (MDT)
Received: from sca-es-mail-2.sun.com ([192.18.43.133])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KZF00C9SPSC7470@brm-avmta-1.central.sun.com> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@SUN.COM); Wed,
 17 Mar 2010 10:29:01 -0600 (MDT)
Received: from fe-sfbay-09.sun.com ([192.18.43.129])
	by sca-es-mail-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id o2HGT0VG024625	for
 <PSARC-ext@SUN.COM>; Wed, 17 Mar 2010 09:29:00 -0700 (PDT)
Received: from conversion-daemon.fe-sfbay-09.sun.com by fe-sfbay-09.sun.com
 (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul  2 2009))
 id <0KZF00600PM2OX00@fe-sfbay-09.sun.com> for PSARC-ext@SUN.COM
 (ORCPT PSARC-ext@SUN.COM); Wed, 17 Mar 2010 09:29:00 -0700 (PDT)
Received: from [192.168.251.11] ([unknown] [76.93.15.33])
 by fe-sfbay-09.sun.com
 (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul  2 2009))
 with ESMTPSA id <0KZF000FVPS8LW30@fe-sfbay-09.sun.com> for PSARC-ext@SUN.COM
 (ORCPT PSARC-ext@SUN.COM); Wed, 17 Mar 2010 09:28:56 -0700 (PDT)
Date: Wed, 17 Mar 2010 09:28:56 -0700
From: "Garrett D'Amore" <gdamore@sun.com>
Subject: Re: 2010/078 [xgrep]
In-reply-to: <e21eff1d1003170910m6f928bc8sc38df9159c81ba9f@mail.gmail.com>
Sender: Garrett.Damore@sun.com
To: =?KOI8-R?Q?=CF=CC=D8=C7=C1_=CB=D2=D9=D6=C1=CE=CF=D7=D3=CB=C1=D1?=
 <olga.kryzhanovska@gmail.com>
Cc: Glenn Skinner <glenn.skinner@covad.net>, PSARC-ext@sun.com,
        ksh93-integration-discuss@opensolaris.org,
        Glenn Fowler <gsf@research.att.com>
Message-id: <4BA10348.2080909@sun.com>
MIME-version: 1.0
Content-type: text/plain; format=flowed; charset=KOI8-R
Content-transfer-encoding: 8BIT
X-PMX-Version: 5.4.1.325704
References: <201003022055.o22KteQ6016524@sac.sfbay.sun.com>
 <416161EE-627E-4AA9-A9AC-59AAAD3E4916@covad.net>
 <e21eff1d1003021419r2bfad739kb2d6f5aff87a801@mail.gmail.com>
 <e21eff1d1003042345s27d267eal10099501ca036cd0@mail.gmail.com>
 <e21eff1d1003170910m6f928bc8sc38df9159c81ba9f@mail.gmail.com>
User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.1.7) Gecko/20100131
 Lightning/1.0b1 Thunderbird/3.0.1
Status: RO
Content-Length: 3607

I think we were still waiting for Glenn's reply that he was satisfied.  
We still have not received a +1 from another member.

Glenn, are you satisfied with responses to your concerns?

Alternatively, at this point, a response from any other member would work.

     - Garrett

On 03/17/10 09:10 AM, ольга крыжановская wrote:
> Is this case now approved?
>
> Olga
>
> 2010/3/5 ольга крыжановская<olga.kryzhanovska@gmail.com>:
>    
>> 2010/3/2 ольга крыжановская<olga.kryzhanovska@gmail.com>:
>>      
>>> On Tue, Mar 2, 2010 at 10:44 PM, Glenn Skinner<glenn.skinner@covad.net>  wrote:
>>>        
>>>> On Mar 2, 2010, at 12:55 PM, Garrett D'Amore - sun microsystems wrote:
>>>>
>>>>          
>>>>> This project is an amendment to the Korn Shell 93 Integration project
>>>>> (PSARC/2006/550 and PSARC/2007/035, PSARC/2008/094, PSARC/2008/344
>>>>> and PSARC/2008/589) specifying the following additional
>>>>> interfaces:
>>>>> Addition of /usr/bin/xgrep
>>>>>
>>>>> Bug/RFE Number(s):
>>>>>
>>>>> 6929154  RFE: Add /usr/bin/xgrep (Augmented regular expressions
>>>>>         (conjunction, negation.))
>>>>>
>>>>>
>>>>> Interface                    Stability        Description
>>>>> ---------                    ---------        -----------
>>>>> /usr/bin/xgrep               Committed        xgrep command
>>>>> ksh93 'xgrep' built in       Committed        xgrep command
>>>>>            
>>>> Before I give this case my +1, I have some questions:
>>>>
>>>> The case's specification should define the syntax of the regular expressions
>>>> the utility accepts.  I suspect that the variants requested by the -E, -F,
>>>> -G, and -P flags can be handled with references to the corresponding man
>>>> pages.  But what is the specification for -X mode REs (including the
>>>> semantics of alternation and conjunction)?
>>>>          
>>> -X is like POSIX grep -E (egrep) but adds&  as AND operator and ! as
>>> NOT operator.
>>>
>>>        
>>>> What is the difference between lenient and strict pattern interpretation?
>>>>          
>>> Strict will print syntax errors if the pattern does not match the
>>> standard exactly. I leave the exact explanation to Glenn Fowler.
>>>        
>> Glenn's replied this:
>> --------------------------------
>> -O, --lenient sets the regcomp(3) REG_LENIENT flag
>> in general if REG_LENIENT is on then certain constructs marked
>> "unspecified" in the standard will be accepted, otherwise they
>> may produce regcomp(3) errors
>>
>> e.g.
>>
>> invalid \char escape
>>
>>        grep -S '\#'<<<'#'
>>
>> invalid [...] range endpoint
>>
>>        grep -S '[a-q-z]'<<<'a'
>>
>> the intention (theory) is that RE's that make it through -S, --strict
>> will make it through all conformant implementations
>>
>> as counterexamples roll in I tweak libast/reg*.c to make pratice match theory
>> --------------------------------
>>
>> 'lenient' mode by default may be an option (i.e. look at Garrett
>> D'Amore proposal for moving /usr/xpg4/bin to /usr/bin, AST grep would
>> keep strong backwards compatibility sans the dreaded i18n bugs in the
>> current /usr/bin/grep) if we replace /usr/bin/grep and friends with
>> this grep implementation and use 'strict' mode for /usr/xpg4/bin/grep.
>>
>> Olga
>> --
>>       ,   _                                    _   ,
>>      { \/`o;====-    Olga Kryzhanovska   -====;o`\/ }
>> .----'-/`-/     olga.kryzhanovska@gmail.com   \-`\-'----.
>>   `'-..-| /     Solaris/BSD//C/C++ programmer   \ |-..-'`
>>       /\/\                                     /\/\
>>       `--`                                      `--`
>>
>>      
>
>
>    


From glenn.skinner@covad.net Wed Mar 17 10:11:05 2010
Received: from newsunmail1brm.central.sun.com (newsunmail1brm.Central.Sun.COM [129.147.62.245])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id o2HHB5A2013823
	for <psarc-ext@sac.sfbay.sun.com>; Wed, 17 Mar 2010 10:11:05 -0700 (PDT)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by newsunmail1brm.central.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.4) with ESMTP id o2HHB3Zj032392
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Wed, 17 Mar 2010 11:11:05 -0600 (MDT)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KZF00F1RRQGID00@nwk-avmta-1.sfbay.Sun.COM> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Wed, 17 Mar 2010 10:11:04 -0700 (PDT)
Received: from sca-ea-mail-3.sun.com ([192.18.43.21])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KZF00AV2RQE1I70@nwk-avmta-1.sfbay.Sun.COM> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Wed,
 17 Mar 2010 10:11:03 -0700 (PDT)
Received: from relay41i.sun.com ([192.5.209.70])
	by sca-ea-mail-3.sun.com (8.13.6+Sun/8.12.9) with ESMTP id o2HH7Nx7005532	for
 <PSARC-ext@sun.com>; Wed, 17 Mar 2010 17:11:02 +0000 (GMT)
Received: from mmp42es.mmp.us.syntegra.com ([160.41.221.11] [160.41.221.11])
 by relay41i.sun.com with ESMTP id BT-MMP-2530668 for PSARC-ext@sun.com; Wed,
 17 Mar 2010 17:10:57 +0000 (Z)
Received: from relay42i.sun.com (relay42i.sun.com [192.5.209.72])
 by mmp42es.mmp.us.syntegra.com with ESMTP id BT-MMP-44709968 for
 PSARC-ext@sun.com; Wed, 17 Mar 2010 17:10:56 +0000 (Z)
Received: from mail156c8.megamailservers.com
 ([209.235.129.66] [209.235.129.66]) by relay4i.sun.com with ESMTP id
 BT-MMP-60982629 for PSARC-ext@sun.com; Wed, 17 Mar 2010 17:10:56 +0000 (Z)
Received: from [192.168.1.106]
 (h-64-105-36-23.snvacaid.static.covad.net [64.105.36.23])
	by mail156c8.megamailservers.com (8.13.6/8.13.1) with ESMTP id o2HHA9op024069;
 Wed, 17 Mar 2010 13:10:10 -0400
Date: Wed, 17 Mar 2010 10:10:08 -0700
From: Glenn Skinner <glenn.skinner@covad.net>
Subject: Re: 2010/078 [xgrep]
In-reply-to: <4BA10348.2080909@sun.com>
To: PSARC-ext@sun.com
Cc: =?KOI8-R?B?z8zYx8Egy9LZ1sHOz9fTy8HR?= <olga.kryzhanovska@gmail.com>,
        ksh93-integration-discuss@opensolaris.org,
        Glenn Fowler <gsf@research.att.com>
Message-id: <C30A072B-D00E-466E-8A08-288E3E86DA59@covad.net>
MIME-version: 1.0
X-Mailer: Apple Mail (2.936)
Content-type: text/plain; charset=KOI8-R; format=flowed; delsp=yes
X-PMX-Version: 5.4.1.325704
X-Brightmail-Tracker: AAAAAA==
X-POP-User: jeannette.cosby@covad.net
X-Antispam: No, score=-1.2/5.0, scanned in 0.099sec at (localhost [127.0.0.1])
	by smf-spamd v1.3.1 - http://smfs.sf.net/
References: <201003022055.o22KteQ6016524@sac.sfbay.sun.com>
 <416161EE-627E-4AA9-A9AC-59AAAD3E4916@covad.net>
 <e21eff1d1003021419r2bfad739kb2d6f5aff87a801@mail.gmail.com>
 <e21eff1d1003042345s27d267eal10099501ca036cd0@mail.gmail.com>
 <e21eff1d1003170910m6f928bc8sc38df9159c81ba9f@mail.gmail.com>
 <4BA10348.2080909@sun.com>
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by sac.sfbay.sun.com id o2HHB5A2013823
Status: RO
Content-Length: 3810

On Mar 17, 2010, at 9:28 AM, Garrett D'Amore wrote:

> I think we were still waiting for Glenn's reply that he was  
> satisfied.  We still have not received a +1 from another member.
>
> Glenn, are you satisfied with responses to your concerns?

Oops, sorry.  The case inadvertently fell off my radar screen.  See  
comments interleaved below.

> On 03/17/10 09:10 AM, ольга крыжановская wrote:
>> Is this case now approved?
>>
>> Olga
>>
>> 2010/3/5 ольга крыжановская<olga.kryzhanovska@gmail.com>:
>>
>>> 2010/3/2 ольга крыжановская<olga.kryzhanovska@gmail.com>:
>>>
>>>> On Tue, Mar 2, 2010 at 10:44 PM, Glenn Skinner<glenn.skinner@covad.net 
>>>> >  wrote:
>>>>
>>>>> On Mar 2, 2010, at 12:55 PM, Garrett D'Amore - sun microsystems  
>>>>> wrote:
>>>>>>
>>>>>>
>>>>>> Interface                    Stability        Description
>>>>>> ---------                    ---------        -----------
>>>>>> /usr/bin/xgrep               Committed        xgrep command
>>>>>> ksh93 'xgrep' built in       Committed        xgrep command
>>>>>>
>>>>> Before I give this case my +1, I have some questions:
>>>>>
>>>>> The case's specification should define the syntax of the regular  
>>>>> expressions
>>>>> the utility accepts.  I suspect that the variants requested by  
>>>>> the -E, -F,
>>>>> -G, and -P flags can be handled with references to the  
>>>>> corresponding man
>>>>> pages.  But what is the specification for -X mode REs (including  
>>>>> the
>>>>> semantics of alternation and conjunction)?
>>>>>
>>>> -X is like POSIX grep -E (egrep) but adds&  as AND operator and !  
>>>> as
>>>> NOT operator.

It's typical for man pages for grep variants to have a subsection  
called "REGULAR EXPRESSIONS" whose contents lay out the rules for the  
syntax of the REs the utility accepts and of how matching works.  I'm  
looking for something similar here.  (Some questions I'd hope the  
section would answer:  What are the precedences of the '&' and '!"  
operators?  When the '&' operator is used, if there's more than one  
common substring matched by its left and right hand operands, which  
one wins?  Can precedences be overridden by using parentheses to group  
sub-expressions?)

Stated differently, the spec should contain enough information to  
allow someone using xgrep to construct and use a regular expression  
for a given purpose.

(Stated differently still, I want to know what I'm buying.)

On Mar 2, 2010, at 2:19 PM, ольга крыжановская wrote:

> On Tue, Mar 2, 2010 at 10:44 PM, Glenn Skinner <glenn.skinner@covad.net 
> > wrote:
>
>> What is the default for the -H, -h option pair?  The traditional grep
>> utility only prefixes matches with file names when there's more  
>> than one
>> source file.  Is there a way to request compatibility with that  
>> behavior?
>> (I think there should be.)
>
> This is already the default.
>
> Try:
> builtin xgrep
> xgrep ksh /etc/profile /etc/profile

Just to make sure I understand, if neither of -h nor -H is given,  
xgrep will only include file names when there's more than one file  
named on the command line.  If one of -h or -H is given, it  
unconditionally (respectively) doesn't or does include them.  Do I  
have that right?  (If so, it would be good if the man page were to  
state this behavior explicitly.)

>> If conflicting options are given on the command line, which one  
>> wins?  The
>> first, the last, is it an error?
>
> Should be an error unless POSIX defines it else for this option.

Your answer is ambiguous.  I'd like a definite answer.  (I'm pushing  
on this one because "last one wins" is useful for defining aliases;  
the alias definition includes one of a pair of conflicting options,  
but an invocation of the alias can still override by explicitly  
mentioning the other option of the pair.)

		-- Glenn



From gsf@research.att.com Wed Mar 17 11:59:47 2010
Received: from sunmail3mpk.sfbay.sun.com (sunmail3mpk.SFBay.Sun.COM [129.146.11.52])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id o2HIxkd2016755
	for <psarc-ext@sac.sfbay.sun.com>; Wed, 17 Mar 2010 11:59:46 -0700 (PDT)
Received: from nwk-avmta-1.SFBay.Sun.COM (nwk-avmta-1.SFBay.Sun.COM [129.146.11.74])
	by sunmail3mpk.sfbay.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.4) with ESMTP id o2HIxkFB015745
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Wed, 17 Mar 2010 11:59:46 -0700 (PDT)
Received: from pmxchannel-daemon.nwk-avmta-1.sfbay.Sun.COM by
 nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KZF00I19WRMFK00@nwk-avmta-1.sfbay.Sun.COM> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Wed, 17 Mar 2010 11:59:46 -0700 (PDT)
Received: from brmea-mail-1.sun.com ([192.18.98.31])
 by nwk-avmta-1.sfbay.Sun.COM
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KZF00KOYWQ5ZZC0@nwk-avmta-1.sfbay.Sun.COM> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Wed,
 17 Mar 2010 11:58:54 -0700 (PDT)
Received: from relay11i.sun.com
 (ip121.net129179-4.block1.us.syntegra.com [129.179.4.121])
	by brmea-mail-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id o2HIwrNF001394	for
 <PSARC-ext@sun.com>; Wed, 17 Mar 2010 18:58:53 +0000 (GMT)
Received: from mmp12es.mmp.us.syntegra.com ([160.41.208.12] [160.41.208.12])
 by relay11i.sun.com with ESMTP id BT-MMP-1665998 for PSARC-ext@sun.com; Wed,
 17 Mar 2010 18:58:53 +0000 (Z)
Received: from relay14i.sun.com (relay14i.sun.com [129.179.4.124])
 by mmp12es.mmp.us.syntegra.com with ESMTP id BT-MMP-69356956 for
 PSARC-ext@sun.com; Wed, 17 Mar 2010 18:58:52 +0000 (Z)
Received: from mail-yellow.research.att.com ([192.20.225.112] [192.20.225.112])
 by relay1i.sun.com with ESMTP id BT-MMP-2934094 for PSARC-ext@sun.com; Wed,
 17 Mar 2010 18:58:52 +0000 (Z)
Received: from penguin.research.att.com
 (penguin.research.att.com [135.207.176.48])	by mail-green.research.att.com
 (Postfix) with ESMTP id 4F6D66BD0C; Wed, 17 Mar 2010 14:58:52 -0400 (EDT)
Received: (from gsf@localhost)	by penguin.research.att.com
 (8.13.8/8.12.10/Submit) id o2HIwppJ007757; Wed, 17 Mar 2010 14:58:51 -0400
Date: Wed, 17 Mar 2010 14:58:51 -0400
From: Glenn Fowler <gsf@research.att.com>
Subject: Re: 2010/078 [xgrep]
To: glenn.skinner@covad.net, PSARC-ext@sun.com
Cc: ksh93-integration-discuss@opensolaris.org, olga.kryzhanovska@gmail.com
Message-id: <201003171858.o2HIwppJ007757@penguin.research.att.com>
Organization: AT&T Research
MIME-version: 1.0
X-Mailer: mailx (AT&T/BSD) 9.9 2009-06-09
Content-type: text/plain; charset=us-ascii
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
X-Brightmail-Tracker: AAAAAA==
X-Antispam: No, score=-1.1/5.0, scanned in 0.066sec at (localhost [127.0.0.1])
	by smf-spamd v1.3.1 - http://smfs.sf.net/
References: <201003022055.o22KteQ6016524@sac.sfbay.sun.com>
 <416161EE-627E-4AA9-A9AC-59AAAD3E4916@covad.net>
 <e21eff1d1003021419r2bfad739kb2d6f5aff87a801@mail.gmail.com>
 <e21eff1d1003042345s27d267eal10099501ca036cd0@mail.gmail.com>
 <e21eff1d1003170910m6f928bc8sc38df9159c81ba9f@mail.gmail.com>
 <4BA10348.2080909@sun.com> <C30A072B-D00E-466E-8A08-288E3E86DA59@covad.net>
Status: RO
Content-Length: 1931


On Wed, 17 Mar 2010 10:10:08 -0700 Glenn Skinner wrote:
> It's typical for man pages for grep variants to have a subsection  
> called "REGULAR EXPRESSIONS" whose contents lay out the rules for the  
> syntax of the REs the utility accepts and of how matching works.  I'm  
> looking for something similar here.  (Some questions I'd hope the  
> section would answer:  What are the precedences of the '&' and '!"  
> operators?  When the '&' operator is used, if there's more than one  
> common substring matched by its left and right hand operands, which  
> one wins?  Can precedences be overridden by using parentheses to group  
> sub-expressions?)

I'll put something together
it's basically extended regular expressions with some additions
can the description be a pointer to the extended description
plus details on the additions?

> Just to make sure I understand, if neither of -h nor -H is given,  
> xgrep will only include file names when there's more than one file  
> named on the command line.  If one of -h or -H is given, it  
> unconditionally (respectively) doesn't or does include them.  Do I  
> have that right?  (If so, it would be good if the man page were to  
> state this behavior explicitly.)

correct
I'll add the default behavior to DESCRIPTION

> >> If conflicting options are given on the command line, which one  
> >> wins?  The
> >> first, the last, is it an error?
> >
> > Should be an error unless POSIX defines it else for this option.

> Your answer is ambiguous.  I'd like a definite answer.  (I'm pushing  
> on this one because "last one wins" is useful for defining aliases;  
> the alias definition includes one of a pair of conflicting options,  
> but an invocation of the alias can still override by explicitly  
> mentioning the other option of the pair.)

last one, left to right, wins -- "alias friendly" is the ast default

-- Glenn Fowler -- at&t Research, Florham Park NJ --


From glenn.skinner@covad.net Wed Mar 17 17:20:02 2010
Received: from newsunmail1brm.central.sun.com (newsunmail1brm.Central.Sun.COM [129.147.62.245])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id o2I0K1EZ022215
	for <psarc-ext@sac.sfbay.sun.com>; Wed, 17 Mar 2010 17:20:02 -0700 (PDT)
Received: from brm-avmta-1.central.sun.com (brm-avmta-1.Central.Sun.COM [129.147.4.11])
	by newsunmail1brm.central.sun.com (8.13.7+Sun/8.13.7/ENSMAIL,v2.4) with ESMTP id o2I0K1Iq028441
	for <@sunmail2sca.sfbay.sun.com:PSARC-ext@sun.com>; Wed, 17 Mar 2010 18:20:01 -0600 (MDT)
Received: from pmxchannel-daemon.brm-avmta-1.central.sun.com by
 brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 id <0KZG00M07BLDQM00@brm-avmta-1.central.sun.com> for PSARC-ext@sun.com
 (ORCPT PSARC-ext@sun.com); Wed, 17 Mar 2010 18:20:01 -0600 (MDT)
Received: from sca-ea-mail-1.sun.com ([192.18.43.24])
 by brm-avmta-1.central.sun.com
 (Sun Java System Messaging Server 6.2-3.04 (built Jul 15 2005))
 with ESMTP id <0KZG004UTBLC8FA0@brm-avmta-1.central.sun.com> for
 PSARC-ext@sun.com (ORCPT PSARC-ext@sun.com); Wed,
 17 Mar 2010 18:20:00 -0600 (MDT)
Received: from relay43i.sun.com ([192.5.209.74])
	by sca-ea-mail-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id o2I06FIt018230	for
 <PSARC-ext@sun.com>; Thu, 18 Mar 2010 00:19:59 +0000 (GMT)
Received: from mmp43es.mmp.us.syntegra.com ([160.41.221.12] [160.41.221.12])
 by relay43i.sun.com with ESMTP id BT-MMP-954833 for PSARC-ext@sun.com; Thu,
 18 Mar 2010 00:19:51 +0000 (Z)
Received: from relay42i.sun.com (relay42i.sun.com [192.5.209.72])
 by mmp43es.mmp.us.syntegra.com with ESMTP id BT-MMP-44936535 for
 PSARC-ext@sun.com; Thu, 18 Mar 2010 00:19:51 +0000 (Z)
Received: from mail156c8.megamailservers.com
 ([209.235.129.66] [209.235.129.66]) by relay4i.sun.com with ESMTP id
 BT-MMP-61443041 for PSARC-ext@sun.com; Thu, 18 Mar 2010 00:19:51 +0000 (Z)
Received: from [192.168.1.106]
 (h-64-105-36-23.snvacaid.static.covad.net [64.105.36.23])
	by mail156c8.megamailservers.com (8.13.6/8.13.1) with ESMTP id o2I0JAJT030221;
 Wed, 17 Mar 2010 20:19:11 -0400
Date: Wed, 17 Mar 2010 17:19:10 -0700
From: Glenn Skinner <glenn.skinner@covad.net>
Subject: Re: 2010/078 [xgrep]
In-reply-to: <201003171858.o2HIwppJ007757@penguin.research.att.com>
To: Glenn Fowler <gsf@research.att.com>
Cc: PSARC-ext@sun.com, ksh93-integration-discuss@opensolaris.org,
        olga.kryzhanovska@gmail.com
Message-id: <0B0C6C87-3733-42AF-9A6C-A09CDCFFC5D4@covad.net>
MIME-version: 1.0
X-Mailer: Apple Mail (2.936)
Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
Content-transfer-encoding: 7BIT
X-PMX-Version: 5.4.1.325704
X-Brightmail-Tracker: AAAAAA==
X-POP-User: glenn.skinner@covad.net
X-Antispam: No, score=-0.7/5.0, scanned in 0.237sec at (localhost [127.0.0.1])
	by smf-spamd v1.3.1 - http://smfs.sf.net/
References: <201003022055.o22KteQ6016524@sac.sfbay.sun.com>
 <416161EE-627E-4AA9-A9AC-59AAAD3E4916@covad.net>
 <e21eff1d1003021419r2bfad739kb2d6f5aff87a801@mail.gmail.com>
 <e21eff1d1003042345s27d267eal10099501ca036cd0@mail.gmail.com>
 <e21eff1d1003170910m6f928bc8sc38df9159c81ba9f@mail.gmail.com>
 <4BA10348.2080909@sun.com> <C30A072B-D00E-466E-8A08-288E3E86DA59@covad.net>
 <201003171858.o2HIwppJ007757@penguin.research.att.com>
Status: RO
Content-Length: 1229

On Mar 17, 2010, at 11:58 AM, Glenn Fowler wrote:

> On Wed, 17 Mar 2010 10:10:08 -0700 Glenn Skinner wrote:
>> It's typical for man pages for grep variants to have a subsection
>> called "REGULAR EXPRESSIONS" whose contents lay out the rules for the
>> syntax of the REs the utility accepts and of how matching works.  I'm
>> looking for something similar here.  (Some questions I'd hope the
>> section would answer:  What are the precedences of the '&' and '!"
>> operators?  When the '&' operator is used, if there's more than one
>> common substring matched by its left and right hand operands, which
>> one wins?  Can precedences be overridden by using parentheses to  
>> group
>> sub-expressions?)
>
> I'll put something together
> it's basically extended regular expressions with some additions
> can the description be a pointer to the extended description
> plus details on the additions?

At the architectural review level, all I care is that the case  
materials fully describe RE syntax and semantics.  If structuring the  
man page the way you propose above does that, then I'm happy.  And  
assuming that that will happen, I'll give my +1 now (I'm satisfied  
with the answers to my other questions).

		-- Glenn


From gdamore@sun.com Tue Mar 23 08:45:42 2010
Received: from dm-sfbay-02.sfbay.sun.com (dm-sfbay-02.SFBay.Sun.COM [129.146.11.31])
	by sac.sfbay.sun.com (8.13.8+Sun/8.13.8) with ESMTP id o2NFjgjj017664
	for <psarc-ext@sac.sfbay.sun.com>; Tue, 23 Mar 2010 08:45:42 -0700 (PDT)
Received: from sca-es-mail-1.sun.com (sca-es-mail-1.Sun.COM [192.18.43.132])
	by dm-sfbay-02.sfbay.sun.com (8.13.8+Sun/8.13.8/ENSMAIL,v2.4) with ESMTP id o2NFjgQE020496
	for <psarc-ext@sac.sfbay.sun.com>; Tue, 23 Mar 2010 08:45:42 -0700 (PDT)
Received: from fe-sfbay-10.sun.com ([192.18.43.129])
	by sca-es-mail-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id o2NFja9A025996
	for <psarc-ext@sac.sfbay.sun.com>; Tue, 23 Mar 2010 08:45:36 -0700 (PDT)
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: text/plain; CHARSET=US-ASCII; format=flowed
Received: from conversion-daemon.fe-sfbay-10.sun.com by fe-sfbay-10.sun.com
 (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul  2 2009))
 id <0KZQ00D00RKNBL00@fe-sfbay-10.sun.com> for psarc-ext@sac.sfbay.sun.com;
 Tue, 23 Mar 2010 08:45:36 -0700 (PDT)
Received: from [192.168.251.11] ([unknown] [76.93.15.33])
 by fe-sfbay-10.sun.com
 (Sun Java(tm) System Messaging Server 7u2-7.04 64bit (built Jul  2 2009))
 with ESMTPSA id <0KZQ00HBBRS05LC0@fe-sfbay-10.sun.com> for
 psarc-ext@sac.sfbay.sun.com; Tue, 23 Mar 2010 08:45:36 -0700 (PDT)
Date: Tue, 23 Mar 2010 08:45:36 -0700
From: "Garrett D'Amore" <gdamore@sun.com>
Subject: 2010/078 xgrep
Sender: Garrett.Damore@sun.com
To: psarc-ext <psarc-ext@sac.sfbay.sun.com>
Message-id: <4BA8E220.3070704@sun.com>
User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.1.7) Gecko/20100131
 Lightning/1.0b1 Thunderbird/3.0.1
Status: RO
Content-Length: 235

This case has its plus one, and has timed out; further it was reviewed 
at PSARC business a couple of weeks ago -- we were just waiting for 
Glenn's reply, which is this case now has.

This case is now closed approved.

     - Garrett

