GNU bug report logs - #8090
new programs: strerror(1) and strsignal(1)?

Previous Next

Package: coreutils;

Reported by: Bruce Korb <bruce.korb <at> gmail.com>

Date: Sun, 20 Feb 2011 22:44:02 UTC

Severity: wishlist

Tags: wontfix

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #23 received at 8090 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: "Alan Curry" <pacman-cu <at> kosh.dhis.org>
Cc: Bruce Korb <bruce.korb <at> gmail.com>, 8090 <at> debbugs.gnu.org
Subject: Re: bug#8090: strerror(1) and strsignal(1)?
Date: Mon, 21 Feb 2011 17:16:49 +0100
Alan Curry wrote:
> Bruce Korb writes:
>>
>> Hi Jim,
>>
>> On 02/20/11 15:20, Jim Meyering wrote:
>> > Bruce Korb wrote:
>> > Hi Bruce,
>> >
>> > [your subject mentions strsignal -- you know you can get a list
>> >  via "env kill --table", assuming you have kill from coreutils? ]
>
> What's the installation rate of coreutils-kill vs. procps kill? Debian
> chooses procps kill (except on Hurd and maybe freebsd-kernel)

Actually, you can also use shell-builtin functions, so
whether coreutils' kill program is installed matters less:

    $ bash -c 'builtin kill -l 3'
    SIGQUIT
    $ zsh -c 'builtin kill -l 3'
    QUIT

>> > I've had that itch many times.
>> > Here are some handy bash/perl functions I wrote:
>>
>> Yep.  I know one can get to it via perl.  OTOH, _you've_ had that
>> itch many times, Padraig's had that itch many times, and I'd take
>> a wild guess that there have been a few others, too.  So it still
>
> You guys don't perl-golf well.
>
> perl -E'say$!=11'
>
> or for older perls
>
> perl -le'print$!=11'

Those are cute, and no doubt minimal,
but for something like this, I would favor readability
(yeah, the quotes make it ugly) over minimality:

errno-int-to-msg()
{
  local fail=0
  case $# in 1) case $1 in [0-9]*) ;; *) fail=1;; esac;; *) fail=1;; esac
  test $fail = 1 && { echo "Usage: $FUNCNAME ERRNO_INT" 1>&2; return 1; }
  perl -le '$!='"$1"'; print $!'
}




This bug report was last modified 6 years and 269 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.