bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: grep . /; echo $?


From: Charles Levert
Subject: Re: grep . /; echo $?
Date: Thu, 3 Nov 2005 02:23:31 -0500
User-agent: Mutt/1.4.1i

* On Thursday 2005-11-03 at 04:35:42 +0000, Julian Foad wrote:
> Charles Levert wrote:
> >This was trivial to modify after all.
> >
> >Ok to apply?
> 
> Not sure.  If we're happy with the change in behaviour then yes, your patch 
> looks good,

Ok.


> but I have a feeling that such a change could be seen as a 
> major regression by many people.
> 
> From what you have found in the code, it appears that the behaviour was 
> changed such that "directories=read" behaves the same as 
> "directories=skip".

On read() errors.


> I can't yet imagine why this was done,

This is now the output:

========================================
bash$ src/grep asdf *; echo $?
src/grep: autom4te.cache: Is a directory
src/grep: bootstrap: Is a directory
src/grep: djgpp: Is a directory
src/grep: doc: Is a directory
src/grep: intl: Is a directory
src/grep: lib: Is a directory
src/grep: m4: Is a directory
src/grep: po: Is a directory
src/grep: src: Is a directory
src/grep: tests: Is a directory
src/grep: vms: Is a directory
2
========================================

Maybe some find the messages annoying?
Maybe some object to the exit code?


> but I think we have a 
> duty (to the users) to try to find out.  Maybe the CVS archives or possibly 
> the mail archives can help.


This is the change to the documentation.

] Working file: grep/doc/grep.texi
] ----------------------------
] revision 1.41
] date: 2001/08/25 16:25:54;  author: alainm;  state: Exp;  lines: +4 -4
]         * doc/grep.texi: Point out that some Platforms do not support
]         reading of directories and silently ignore them.
] ----------------------------
] 2001-08-25  Heikki Korpela
] 
]         * doc/grep.texi: Point out that some Platforms do not support
]         reading of directories and silently ignore them.


This is the first change to check is the read()
error was EISDIR.

] Working file: grep/src/grep.c
] ----------------------------
] revision 1.10
] date: 1998/11/10 00:29:38;  author: alainm;  state: Exp;  lines: +16 -7
] 
] 
] Changes from P. E. for the recurse behaviour.
] ----------------------------
] 1998-11-09  Paul Eggert
] 
]         * src/grep.c (is_EISDIR): New macro.
]         (grep): If -s, suppress errors from trying to read directories.
]         (grepfile): Use is_EISDIR to simplify code.
]         (grepdir): If -s, suppress errors from trying to read directories.


The following changed the logic slightly,
mostly so that read() errors on directories are
always ignored (not just when the user asked
for suppression), and that only the messages be
suppressed for non-directories (but not the >1
exit code).

] Working file: grep/src/grep.c
] ----------------------------
] revision 1.51
] date: 2001/02/08 16:12:10;  author: alainm;  state: Exp;  lines: +22 -12
] Exit status fix.
] ----------------------------
] No ChangeLog entry.


I didn't find anything around those dates on
the mailing list (bug-gnu-utils, back then).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]