GNU bug report logs -
#12580
yes ignores POSIXLY_CORRECT and cannot be stopped (coreutils 8.15)
Previous Next
Reported by: Marius Spix <marius.spix <at> web.de>
Date: Fri, 5 Oct 2012 15:52:02 UTC
Severity: normal
Tags: notabug
Done: Eric Blake <eblake <at> redhat.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 12580 in the body.
You can then email your comments to 12580 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-coreutils <at> gnu.org
:
bug#12580
; Package
coreutils
.
(Fri, 05 Oct 2012 15:52:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Marius Spix <marius.spix <at> web.de>
:
New bug report received and forwarded. Copy sent to
bug-coreutils <at> gnu.org
.
(Fri, 05 Oct 2012 15:52:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hello (sorry for my bad English),
I am using coreutils 8.15 and have noted that `yes' ignores the
environment variable `POSIXLY_CORRECT'.
So the command `env POSIXLY_CORRECT yes --help' does print the help
instead of printing `--help' until killed.
In addition `yes' cannot be killed with CTRL+C (SIGINT) or CTRL+Z
(SIGTSTP) if you call it with another program using the `&' operator of
sh. This causes that `yes & <insert_random_program_name_here>' can only
be stopped with CTRL+D which causes a logoff. `yes & yes'
however can only stopped if killed from another terminal ...
Is this wanted or are these bugs?
Thank you for your acknowledgement.
[signature.asc (application/pgp-signature, attachment)]
Added tag(s) notabug.
Request was from
Eric Blake <eblake <at> redhat.com>
to
control <at> debbugs.gnu.org
.
(Fri, 05 Oct 2012 16:34:02 GMT)
Full text and
rfc822 format available.
Reply sent
to
Eric Blake <eblake <at> redhat.com>
:
You have taken responsibility.
(Fri, 05 Oct 2012 16:34:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Marius Spix <marius.spix <at> web.de>
:
bug acknowledged by developer.
(Fri, 05 Oct 2012 16:34:03 GMT)
Full text and
rfc822 format available.
Message #12 received at 12580-done <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
tag 12580 notabug
thanks
On 10/05/2012 09:47 AM, Marius Spix wrote:
> Hello (sorry for my bad English),
>
> I am using coreutils 8.15 and have noted that `yes' ignores the
> environment variable `POSIXLY_CORRECT'.
Thanks for the report. That's because POSIX does not specify 'yes'.
POSIXLY_CORRECT exists to cause applications specified by POSIX to
behave in the manner specified by POSIX, but since yes is not specified
by POSIX, there's nothing we need to change.
>
> So the command `env POSIXLY_CORRECT yes --help' does print the help
> instead of printing `--help' until killed.
If you want to print "--help" until killed, use:
yes -- --help
POSIX mandates the use of '--' as a delimiter for end-of-options for any
POSIX application not explicitly specified otherwise[1], if you want to
treat a subsequent argument with leading dash as a non-option.
Coreutils has taken that POSIX mandate and applied it to all of its
apps, even those not specified by POSIX, for consistency of use.
[1]echo is one of those POSIX-specified apps that is an exception to the
rule, where 'echo --help' is explicitly specified otherwise to output
'--help' instead of treating it as an option. Hence, in coreutils,
'echo' obeys POSIXLY_CORRECT. But we're talking about 'yes', not 'echo'.
> In addition `yes' cannot be killed with CTRL+C (SIGINT) or CTRL+Z
> (SIGTSTP) if you call it with another program using the `&' operator of
> sh.
That's true for ANY backgrounded application under sh. To kill a
background application, you must either use kill(1), (often a shell
builtin, so that you can type something like 'kill %1' instead of having
to do 'kill $(determine the pid of yes)'), or else use 'fg' to bring it
into the foreground at which point you can once again send it keyboard
input including 'ctrl-c' to cause sigint.
> This causes that `yes & <insert_random_program_name_here>' can only
> be stopped with CTRL+D which causes a logoff. `yes & yes'
> however can only stopped if killed from another terminal ...
>
> Is this wanted or are these bugs?
There are no bugs in what you have reported, just a misunderstanding of
what POSIX specified and how shell backgrounding works. As such, I'm
closing this bug report, but feel free to continue to reply on this
thread if you have more concerns.
--
Eric Blake eblake <at> redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[signature.asc (application/pgp-signature, attachment)]
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 03 Nov 2012 11:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 12 years and 317 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.