GNU bug report logs -
#8090
new programs: strerror(1) and strsignal(1)?
Previous Next
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):
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.