bug-bash
[Top][All Lists]
Advanced

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

Re: Legal trap statement interpreted incorrectly


From: Chet Ramey
Subject: Re: Legal trap statement interpreted incorrectly
Date: Mon, 27 Dec 2004 16:20:03 -0500

> Machine Type: i586-suse-linux
> 
> Bash Version: 3.0
> Patch Level: 0
> Release Status: release
> 
> Description:
> In sh mode the following legal command:
> 
>         trap 13

It's not actually valid, according to POSIX.  Both the action and condition
must be specified.  I changed the bash posix mode in bash-3.0 to follow the
spec, and bash enters posix mode when called as `sh'.

> produces the somewhat comical error message:
> 
>         trap: usage: trap [-lp] [[arg] signal_spec ...]
> 
> (comical because it quite clearly states that the command is legal).

Yes, I did not update the help text for the 3.0 release.  An oversight.

Patch 3 to bash-3.0 restores a certain amount of backwards compatibility
that makes this particular construct work and corrects the help text.

ftp://ftp.cwru.edu/pub/bash/bash-3.0-patches/bash30-003

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
                                                Live...Laugh...Love
Chet Ramey, ITS, CWRU    chet@po.cwru.edu    http://tiswww.tis.cwru.edu/~chet/




reply via email to

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