<<< Date Index >>>     <<< Thread Index >>>

Re: Mutt 1.5.16 editor exit status brain damage



Holger Weiss typed (on Sat, Jun 16, 2007 at 10:34:16PM +0200):
| * Jean-Pierre Radley <jpr@xxxxxxx> [2007-06-16 15:33]:
| > Derek Martin typed (on Sat, Jun 16, 2007 at 01:03:47PM -0400):
| > | It does not apply to other system commands, because:
| > | 
| > |   - The standards assume that "standard utilities" have a non-zero
| > |     exit status when an error condition has occured
| > 
| > Depends on the command. My man page for grep|egrep|fgrep says:
| > 
| >     Exit values
| > 
| >        Exit status is 0 if any matches are found,
| >        1 if no matches are found, and 2 for syntax
| >        errors or inaccessible files.
| 
| This is a nice counter-example to the behaviour of Solaris' Vi, as it
| shows an extremly useful definition of exit values (used in countless
| scripts world-wide) as opposed to the completely useless values Solaris'
| Vi returns (which forces the parent-process to ignore them entirely).
| 
| > Not finding a certain string in some files means that it is *false* that
| > this string resides in these files.  I wouldn't characterize that as any
| > kind of *error*.
| 
| Me not either, and therefore I wouldn't even consider the behaviour of
| Solaris' Vi POSIX compliant, since the standard says that Vi shall exit
| non-zero only if an *error* occurs.  However, no matter whether or not
| such stupid behaviour is formally covered by some standard, the question
| is whether Mutt should explicitely support this behaviour or whether it
| should be left to the user. Personally, I'd opt for the latter.

Current POSIX seems to say that, but go back a few years, and the POSIX
standard said that a search error while in vi adds to the exit status
number; many people still use a vi binary that conforms to that older
standard.

-- 
JP
        ==> http://www.frappr.com/cusm <==