From unknown Wed Jun 18 23:05:50 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#23090 <23090@debbugs.gnu.org> To: bug#23090 <23090@debbugs.gnu.org> Subject: Status: true and false not POSIX Reply-To: bug#23090 <23090@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:05:50 +0000 retitle 23090 true and false not POSIX reassign 23090 coreutils submitter 23090 Ruediger Meier severity 23090 normal tag 23090 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 22 08:43:47 2016 Received: (at submit) by debbugs.gnu.org; 22 Mar 2016 12:43:47 +0000 Received: from localhost ([127.0.0.1]:57859 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiLf0-0001C0-P6 for submit@debbugs.gnu.org; Tue, 22 Mar 2016 08:43:46 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38123) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiLez-0001Bn-2t for submit@debbugs.gnu.org; Tue, 22 Mar 2016 08:43:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiLet-0003Xi-8O for submit@debbugs.gnu.org; Tue, 22 Mar 2016 08:43:39 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:36829) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiLet-0003Xd-5T for submit@debbugs.gnu.org; Tue, 22 Mar 2016 08:43:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57319) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiLes-0007cq-9F for bug-coreutils@gnu.org; Tue, 22 Mar 2016 08:43:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiLep-0003Vv-3p for bug-coreutils@gnu.org; Tue, 22 Mar 2016 08:43:38 -0400 Received: from mout.gmx.net ([212.227.17.21]:55012) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiLeo-0003VV-Qf for bug-coreutils@gnu.org; Tue, 22 Mar 2016 08:43:35 -0400 Received: from zappa.ga.local ([82.139.197.16]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0Lp3Qu-1a5xxo0IcO-00epoc for ; Tue, 22 Mar 2016 13:43:32 +0100 From: Ruediger Meier To: bug-coreutils@gnu.org Subject: true and false not POSIX Date: Tue, 22 Mar 2016 13:43:30 +0100 User-Agent: KMail/1.9.10 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201603221343.31030.sweet_f_a@gmx.de> X-Provags-ID: V03:K0:S/2+cLkMkhRntNkrAzqREsa7XUU8JXeF8VBC0ueNcVqahe44iFv 9z8WBzI0zGslQWzrCvMDIBhX31KlcIhnhU15cRrIPEtbszCFwo4Aazdj56K7pOIFpA+yogl Mzd26Qd8M6E8Y01m1+Ci4gk+oKoWQEPJpSKLzDqfFreLcINtwwUvhqviStFNvLnO5Xp7DzR LxKlB+oGgi1fScWWpPsQQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:YlG2uBbUauU=:rhvUJQdr+cgNgwKRgR8ACz i/qkF6hbuBP1QqU3PIccZwzMz/cGhRx6BRyOZcVeKvMMFN2ueTBon2t8OA0cP5Ysx+qFQcrHt Fp729OHwkBW4d4nZaBL8eZRpBvLAOpoQLrroVVh6B7zpm23oNW+Gw/yB7Cmx9sM7F9Sc4g7JC uMS0T8wC0SXWIKQn5oIcEBvsWS+czuUEzs4UQ2g9A4cIlNwW3S8eEZSYbiGP93OtvACP1odIw VrvenXWOsSIIh57PYvpRWlpcc9O9VqeUgIn3QPEIKLvKCCJ5hhLHciXoZ0y7yceiNKpddT6QY I4VocjEmEGRlFgQG4QXIQMJuUEXUUdbfKXehArOhE8khM2dTGirBH+nw4FFy+7RjqbOJgVLvR /DlsGuy0Z4Z0L83t5r54Xw1s1XKotcABnl66FshSwKnLM3Utyw25QDsoZexnyWTGoCvELgq5h fA09RUmOOtg3K5/qOebAvmrf6nj/Y9cQNCWchtuHYEbq7j4HjxG7kGO2p8IOvTIjRGVkGk4vL C4uNFDncGArfwcbzr8zLb8J5iyb9hr7xv8pZ01zlk4b1uU5c+fpX6r8P/JYT6Pdd64rw6+iEE HF4t7aDFKN6YUSEH1+RvRGKNJBejZVYBlkXayeV+OphgPgzeTrzgD39tOOghcUtBaIEJRqWmU RbVXnhWMXI4bTEYOJxNxmfHEdOCLYxJ7myd0g6+c+dQOVl/om85WLVL7Ku0wzbTRavCYs9cMc iV8+z8MGPJteQmiEVZMcs0G1ir2WXcKENoKAw3doCR8l9wbwmqpD7NU0ylY= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) Hi, Is there any good reason why coreutils true and false are not POSIX? man 1p true: OPTIONS None. STDOUT Not used. But coreutils true has --version and --help implemented. It needs >/dev/null redirection to work as expected. Also these options are the reason why true.c is using many library functions like setlocale, etc. The binary is bloated and the risk that something goes wrong/crashs is much higher. I was looking for a minimal and rock-solid true command to be used in scripts. IMO it is not worth to violate POSIX just because of cosmetical reasons (--help/--version). Moreover since the true command usually comes from the shell I guess that almost no person on earth ever had seen your nice --help output anyways. cu, Rudi From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 22 09:40:33 2016 Received: (at 23090) by debbugs.gnu.org; 22 Mar 2016 13:40:34 +0000 Received: from localhost ([127.0.0.1]:57970 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiMXx-0002fH-NA for submit@debbugs.gnu.org; Tue, 22 Mar 2016 09:40:33 -0400 Received: from mail-wm0-f51.google.com ([74.125.82.51]:35152) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiMXv-0002f4-Hk for 23090@debbugs.gnu.org; Tue, 22 Mar 2016 09:40:32 -0400 Received: by mail-wm0-f51.google.com with SMTP id l68so153460612wml.0 for <23090@debbugs.gnu.org>; Tue, 22 Mar 2016 06:40:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=uKGE6RI/qg06ga/F56K9EOKmkheP8d1RxGY6AnQNb08=; b=pnlVonQBtVEZOxIxPOfZX8Xw2SZxUa8++dWBK9uFkY7v1v3DNb7BepJ+wsWsXtNNUY YerEYz1t8E4M32q0l9kYNLFTtGt5qGg8AOZfnw9/kcKyhVFBKlAVKYFRmobxYDO49eux 7+TVUq8lZ1UkgTz24IjRBX4OA/56da8fvCz4aPA8RvgNSC9xH3s5BmhdrSJ8mAwEanXr hoaaZizFLqIDPN3HRWGwikgJ5CPp3kG8roJ0CMvIGO40XWEteIthIE9PNJ6VfIhVVmZU mMJ7Rjs2mr9W3tXgjPaC4qks7JDsCp4+m2hVPgzWfYZ8AnKT1ZGM7FvM5u9QwxGySXga fx/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=uKGE6RI/qg06ga/F56K9EOKmkheP8d1RxGY6AnQNb08=; b=m1kLeuCXHtbTOZJQBUWrZtIC/ehyOvXbbJUAB6Ld+B7H2Cs9NN63vlCEAxqCYFdf5O SJ8J4qf9sGwFofbkyKHpRSzeisRtYOkn5G6BmbgaYSgsZdZSLyd5dNEeoVdCwGV1KCu2 cvqY/Q0hdY+0NRtCMWlToO0otsXFmSaqv3qeSUSPYFw01z1BNmExOj7d1ZRiRQjW0amG rEsaLPrg/baeVIHw36pM1SbkJngOBzQ8dQwGhrbjSmN1vsiyUo4pkiGRbznxYznqgp2F Wv9PnUjqqRBmC8JTVIs8HX8CjXIFht8cMBoq4Ta994UywOThvMASmo1FyjxWetdjZpfC yB0w== X-Gm-Message-State: AD7BkJLHMpnardj4wbi+7vIFgSfD5CgwpaA8wjxFHXiErs6LIdruttiCD+AuOchxwtPHhw== X-Received: by 10.28.32.16 with SMTP id g16mr20084549wmg.13.1458654025793; Tue, 22 Mar 2016 06:40:25 -0700 (PDT) Received: from chaz.gmail.com (05449dd5.skybroadband.com. [5.68.157.213]) by smtp.gmail.com with ESMTPSA id hq2sm30353576wjb.3.2016.03.22.06.40.24 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 Mar 2016 06:40:24 -0700 (PDT) Date: Tue, 22 Mar 2016 13:40:23 +0000 From: Stephane Chazelas To: Ruediger Meier Subject: Re: bug#23090: true and false not POSIX Message-ID: <20160322134023.GA6518@chaz.gmail.com> References: <201603221343.31030.sweet_f_a@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201603221343.31030.sweet_f_a@gmx.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23090 Cc: 23090@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 2016-03-22 13:43:30 +0100, Ruediger Meier: [...] > Is there any good reason why coreutils true and false are not POSIX? > > man 1p true: > OPTIONS > None. > STDOUT > Not used. > > But coreutils true has --version and --help implemented. It needs > >/dev/null redirection to work as expected. [...] While I'd tend to agree it would be better if they didn't accept options as most other implementations don't, AFAIK, POSIX doesn't forbid "true" implementations to accept options or operands. What those "None" mean is that the behaviour is not specified would an application pass arguments to "true". It doesn't say for instance that if passed any argument, it should ignore them. A conforming application should not pass arguments to "true". There are a number of other utilities that don't accept options in their specification (like "exec", "dirname",...) and still implementations (including certified ones) do support options. You'll notice that for the ":" special builtin, the spec is explicit in that it can take arguments and ignores them. Note that "true" is built in most Bourne like shells, coreutils true would only be invoked if called not as part of a shell command line or if called by path. env true --help /bin/true --help find file -exec true --help \; csh -c 'true --help' rc -c 'true --help' Alternatives to "true" that are guaranteed to be built-in are ":" and "eval" (without argument; also available in csh and rc like shells). "test" is also generally built in Bourne-like shells. For a no-op command that takes arbitrary arguments, there are: sh -c '' awk 'BEGIN{exit}' printf '' -- Stephane From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 22 10:40:02 2016 Received: (at 23090) by debbugs.gnu.org; 22 Mar 2016 14:40:02 +0000 Received: from localhost ([127.0.0.1]:60095 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiNTW-0004a3-4D for submit@debbugs.gnu.org; Tue, 22 Mar 2016 10:40:02 -0400 Received: from mout.gmx.net ([212.227.17.21]:56154) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiNTU-0004ZV-Ul for 23090@debbugs.gnu.org; Tue, 22 Mar 2016 10:40:01 -0400 Received: from zappa.ga.local ([82.139.197.16]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0LbPza-1a3IPo0q7e-00kwZU; Tue, 22 Mar 2016 15:39:54 +0100 From: Ruediger Meier To: Stephane Chazelas Subject: Re: bug#23090: true and false not POSIX Date: Tue, 22 Mar 2016 15:39:52 +0100 User-Agent: KMail/1.9.10 References: <201603221343.31030.sweet_f_a@gmx.de> <20160322134023.GA6518@chaz.gmail.com> In-Reply-To: <20160322134023.GA6518@chaz.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201603221539.52985.sweet_f_a@gmx.de> X-Provags-ID: V03:K0:R+yPW+e04wq//e2C2PhSDy1ZavZI7Q+82ZwR7WZyDCPOWmFpitx REIWQ82V/tB+BRpFNTZGy5MQSMG273hdg5Lfmx7glN79LJGYPO3LCYZ6hOQISc+dTZkr49+ YSyBHvBqZRTaUrggo8sKkGkqWADg4K5dsVC2Ha2YgdjVndXW23Rx5OwBIkCAgv8iSZKecwK uxjhkbb+HTtUHgsXmx/4g== X-UI-Out-Filterresults: notjunk:1;V01:K0:uz8zas+ixsU=:ibnRLJUV9dgq8mcbr31j9K 5I6g+IF1NZavzRMvy3DA/pnBfaokQjAeJqp7S5si628zNskW7PdlSrVN4IwhGR6nFBDsO7ZxN Q3VRVZ+P+sg3xE457Mfc8DUv5b88kdCgIL4BzmPhhUXAegd3uJhh8Mp0cPbDLvg6oQzf7k6sl FmK+8+3tZrD0aAHnFQw3zzTqcrmtuK+lgsmImqFw+z2yGhKfdKYdFdZn/3tjOIMagmxWqSQyV K4u1oWCqgts/0sza8+DjKFarqBfnB8N/mCnbssO+z+oic/3m6/zq3pYApYAhLs25nTKlmGSsS t/ohmDwF1L2gw79d9SoavBCxhG9wFId7UHIgQlH/SOxG1rZ4ABO+RLntvek/HEbUFZ+sLoBlQ xH4Db2uwhLEQL49WdOhznd+e8+VacRGoApBngZ6JbLik0HdqbrmXep8iiOcp7ynVZzKv0PpGx ZDjNafgPo6BFBU/3n3ktQpcvqzlxfBxeJ4g099UAk27hiKn1X8deqEGZAelaH49qGZEiROYYt bwYzQ11iIN6LyaIpHNsTcIYN5eaQPN1vmfLtP3ze6qWeuBN7B4eRMkGc2PT7qF/zbCjnpvqUe jxxzTsmnBS30rnrq7kc4vKgDx1Fn4gxq2laCsfI9xDTcKaKzMWw8RrSOKjvBO75OapV9xjPtl 4CgNfnYG94VkQG0//v0pHqnLCbVfXaAUNFWIeaphPi/Derahevu/+oAjq8EkeX5qXvl3dGB55 EAbczu/BGhrl90kbAOpgZyHBFA8NbAEk1qEyCp/2F2YnkZJOUowEIraZzB4= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23090 Cc: 23090@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Tuesday 22 March 2016, Stephane Chazelas wrote: > 2016-03-22 13:43:30 +0100, Ruediger Meier: > [...] > > > Is there any good reason why coreutils true and false are not > > POSIX? > > > > man 1p true: > > OPTIONS > > None. > > STDOUT > > Not used. > > > > But coreutils true has --version and --help implemented. It needs > > > > >/dev/null redirection to work as expected. > > [...] > > While I'd tend to agree it would be better if they didn't accept > options as most other implementations don't, AFAIK, POSIX > doesn't forbid "true" implementations to accept options or > operands. > > What those "None" mean is that the behaviour is not > specified would an application pass arguments to "true". > > It doesn't say for instance that if passed any argument, it > should ignore them. Ok, but it must not use STDOUT and it must return 0. true --help may predict the future of the stars as long as it exits 0 and does _not_ print anything. > A conforming application should not pass arguments to "true". Why not? > There are a number of other utilities that don't accept options > in their specification (like "exec", "dirname",...) and still > implementations (including certified ones) do support options. You may add options as long as you don't violate the specification. BTW coreutils "echo --help" is also wrong. Here POSIX explicitly says: "Implementations shall not support any options". BTW I know about POSIXLY_CORRECT env. I just ask this: Is it worth to violate parts of POSIX just for minor cosmetical reasons? I mean echo -n/-e may be an improvement though non-posix. But echo --version is a violation just for cosmetics, true --version is even worse. > You'll notice that for the ":" special builtin, the spec is > explicit in that it can take arguments and ignores them. > > Note that "true" is built in most Bourne like shells, coreutils > true would only be invoked if called not as part of a shell > command line or if called by path. > env true --help > /bin/true --help > find file -exec true --help \; > csh -c 'true --help' > rc -c 'true --help' > > Alternatives to "true" that are guaranteed to be built-in are > ":" and "eval" (without argument; also available in csh and rc > like shells). "test" is also generally built in Bourne-like > shells. > > For a no-op command that takes arbitrary arguments, there are: > > sh -c '' > awk 'BEGIN{exit}' > printf '' These are no binaries but shell commandlines. You can't pass it to other programs, like gdb, setarch or whatever. cu, Rudi From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 22 11:08:37 2016 Received: (at 23090) by debbugs.gnu.org; 22 Mar 2016 15:08:37 +0000 Received: from localhost ([127.0.0.1]:60130 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiNvB-0005Ik-Lw for submit@debbugs.gnu.org; Tue, 22 Mar 2016 11:08:37 -0400 Received: from mail-wm0-f41.google.com ([74.125.82.41]:35127) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiNvA-0005IY-57 for 23090@debbugs.gnu.org; Tue, 22 Mar 2016 11:08:36 -0400 Received: by mail-wm0-f41.google.com with SMTP id l68so157469462wml.0 for <23090@debbugs.gnu.org>; Tue, 22 Mar 2016 08:08:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=AJBr45RHpZVPRvADg8TO8QnqDkM2ZlfbhBoXbC6j1cU=; b=PEiQM4cddFYno1Bsy8t10M3NVMf/t2MhoUEx0RG7zCu7KdqgcbelnwJwzsFTNxpsFX 557/GgdrLAa+2t4LMHLklHrOH6cG9bZGENOv0YPfIvQpM/AG27pGRzvD/lFSSUWaHrVV L/0GJFjCj0bGxGdd3NngQgT0TkbTTtDhvDkIh2EWlhv0iDdxCLyL/410rrxttho4bGCT 5ieMpZMeo8vAA3TNLg9LhZyzI6LksnX8+huIjGVj9Wm8o9S+ZY/NbmLN1Q3JNDOFgAvm FKzVfZQIs6hugbj7EjgFAeBozvYpB7Sz34ZSOw2yxidJmf98pM2L/CzDZ18I/5ECD0jk Yc1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=AJBr45RHpZVPRvADg8TO8QnqDkM2ZlfbhBoXbC6j1cU=; b=UJeZuP3CvyUKz1qE8440N+5mZIN+0ZkYIo9+dyr7Ips6JTgOB4QDVEK7Fyd93zN2BW p8IqKXFxUCPNeKRl3f2NpxO4loDBK41QCbjej8Jpo7xv319j7LYQIKk3gjT8lhSLRV9P k1LIrJ66qD0woazdik+tu0fvgsT0RtkdE2AOVVnIi5w+naCia3lb7XjJf9ZmOXmFcTkI NVYsIaDR3nvaekKylWfE1AdK8aeIycurJ6vZyLX/Uj1kpj4HHR/AZIJgltwUuHaXfcVc ezYzqv7PCaK+FaCnluk1WSXWJGk5TZBlBvpLo+sbndB7/4043PYDYGqwTP/ICr0ubFi/ LD/g== X-Gm-Message-State: AD7BkJKaieLdjwf1CVS9miUW0mRabVM6kdRLQMbDEygcBMASWyhrlbwaXPzqxKMAbRlg5g== X-Received: by 10.194.134.134 with SMTP id pk6mr37127943wjb.176.1458659310329; Tue, 22 Mar 2016 08:08:30 -0700 (PDT) Received: from chaz.gmail.com (05449dd5.skybroadband.com. [5.68.157.213]) by smtp.gmail.com with ESMTPSA id w188sm17795330wmw.19.2016.03.22.08.08.28 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 Mar 2016 08:08:29 -0700 (PDT) Date: Tue, 22 Mar 2016 15:08:28 +0000 From: Stephane Chazelas To: Ruediger Meier Subject: Re: bug#23090: true and false not POSIX Message-ID: <20160322150828.GA4796@chaz.gmail.com> References: <201603221343.31030.sweet_f_a@gmx.de> <20160322134023.GA6518@chaz.gmail.com> <201603221539.52985.sweet_f_a@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201603221539.52985.sweet_f_a@gmx.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23090 Cc: 23090@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 2016-03-22 15:39:52 +0100, Ruediger Meier: > On Tuesday 22 March 2016, Stephane Chazelas wrote: > > 2016-03-22 13:43:30 +0100, Ruediger Meier: [...] > Ok, but it must not use STDOUT and it must return 0. > true --help may predict the future of the stars as long as it exits 0 > and does _not_ print anything. No, it is only required to exit with 0 and print nothing if called as specified, that is without arguments. If passed any argument, the behaviour is not specified. Just like dirname --help is unspecified. dirname -- foo/bar is specified as utilities (other than the special builtins that are not required to follow syntax guidelines) that take operands must recognise (and ignore) a leading "--" argument. true -- is not as true doesn't take operands. In practice though, you could do "true -- --arbitrary args being ignored". That seems to work with all the "true" implementations I've tried, but POSIX would still leave that unspecified. > > A conforming application should not pass arguments to "true". > > Why not? Because then the behaviour would be unspecified. > > There are a number of other utilities that don't accept options > > in their specification (like "exec", "dirname",...) and still > > implementations (including certified ones) do support options. > > You may add options as long as you don't violate the specification. > BTW coreutils "echo --help" is also wrong. Here POSIX explicitly > says: "Implementations shall not support any options". Yes, the behaviour of echo when passed a "--help" argument is clearly specified. > BTW I know about POSIXLY_CORRECT env. I just ask this: Is it worth to > violate parts of POSIX just for minor cosmetical reasons? > > I mean echo -n/-e may be an improvement though non-posix. But > echo --version is a violation just for cosmetics, true --version is > even worse. AFAICT, echo --version is a violation, true --version is not. [...] > > sh -c '' > > awk 'BEGIN{exit}' > > printf '' > > These are no binaries but shell commandlines. You can't pass it to other > programs, like gdb, setarch or whatever. POSIX systems are required to have sh, awk and printf commands in the filesystem. There shouldn't be any problem passing them to gdb/setarch/env or whatever. replace the non-portable/non-standard: execlp("true", "true", "--help", "and", "other", "arbitrary", "args", 0); with: execlp("awk", "awk", "BEGIN{exit}", "--help", "sh", "and", "other", "arbitrary", "args", 0); for instance (btw, sh -c '' may not be that good a choice because if sh is yash, you'd get errors if arguments contain invalid characters). -- Stephane From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 22 11:13:49 2016 Received: (at 23090) by debbugs.gnu.org; 22 Mar 2016 15:13:49 +0000 Received: from localhost ([127.0.0.1]:60134 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiO0D-0005Pg-9v for submit@debbugs.gnu.org; Tue, 22 Mar 2016 11:13:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35766) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiO0B-0005PU-8c for 23090@debbugs.gnu.org; Tue, 22 Mar 2016 11:13:47 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 4EE5E12B29; Tue, 22 Mar 2016 15:13:43 +0000 (UTC) Received: from [10.3.113.112] (ovpn-113-112.phx2.redhat.com [10.3.113.112]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2MFDfJd028734; Tue, 22 Mar 2016 11:13:42 -0400 Subject: Re: bug#23090: true and false not POSIX To: Ruediger Meier , 23090@debbugs.gnu.org References: <201603221343.31030.sweet_f_a@gmx.de> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg X-Enigmail-Draft-Status: N1110 Organization: Red Hat, Inc. Message-ID: <56F16124.8080704@redhat.com> Date: Tue, 22 Mar 2016 09:13:40 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <201603221343.31030.sweet_f_a@gmx.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3dFJh13IjUEfLBPewFndqm06N1qSHdXfU" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 23090 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --3dFJh13IjUEfLBPewFndqm06N1qSHdXfU Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03/22/2016 06:43 AM, Ruediger Meier wrote: > Hi, >=20 > Is there any good reason why coreutils true and false are not POSIX? No, because coreutils' true and false ARE compliant with POSIX. > But coreutils true has --version and --help implemented. It needs=20 >> /dev/null redirection to work as expected. Not true. POSIX says that behavior is unspecified for 'true --help'. Therefore, whatever coreutils does in that case does not violate POSIX. 'true -- --help', on the other hand, must be silent - but coreutils obeys that rule. >=20 > Also these options are the reason why true.c is using many library=20 > functions like setlocale, etc. The binary is bloated and the risk that = > something goes wrong/crashs is much higher. I was looking for a minimal= =20 > and rock-solid true command to be used in scripts. If coreutils' true crashes due to wrong file permissions causing setlocale() to fail, your system is already going to have severe problems with other utilities. Coreutils is complying with GNU Coding Standards at the same time as POSIX, and we do not feel that it is bloated for doing so. >=20 > IMO it is not worth to violate POSIX just because of cosmetical reasons= =20 > (--help/--version). Moreover since the true command usually comes from = > the shell I guess that almost no person on earth ever had seen your=20 > nice --help output anyways. On many GNU/Linux systems, 'man true' displays the coreutils' man page for true, which in turn was generated from 'true --help' output. So a lot more people read it than you might think, even if they don't directly invoke it. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --3dFJh13IjUEfLBPewFndqm06N1qSHdXfU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJW8WEkAAoJEKeha0olJ0NqY5YH/1EtAZawCG6xd7hFg5ARrcbm quwSUwJHdtIgrozRYtrXHIYeEEJfrwQvN0VOD97vdru3GGWDWzk/wGL45uA2h3N0 VTaoMPTNCu/CHRvUQ+I89DBl+NXJjBlVumowO9K3QrEFi1bHINUYgKoaDaxjYyJn kwaz/hRUju5xSPtQFMw568nwJZ5QZvFpKMJkyKg+E9g11rT8FymOjfbLlXpMwcG2 s/aK93Fu4y5AEweHMpfU2DKfDVmgLwU1OsGZRPy9FOyyUbroGRk5vYIczoSbfigU 8lQlUBLCyoHWM4FCqzwG2kWAYphXBZRRcwFECP6hNMnPZPt6b6Hnt/6z44fEPXc= =e9nb -----END PGP SIGNATURE----- --3dFJh13IjUEfLBPewFndqm06N1qSHdXfU-- From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 22 11:23:42 2016 Received: (at 23090) by debbugs.gnu.org; 22 Mar 2016 15:23:42 +0000 Received: from localhost ([127.0.0.1]:60139 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiO9m-0005e3-9T for submit@debbugs.gnu.org; Tue, 22 Mar 2016 11:23:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32917) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiO9k-0005dr-Mj for 23090@debbugs.gnu.org; Tue, 22 Mar 2016 11:23:41 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 27FA446208; Tue, 22 Mar 2016 15:23:35 +0000 (UTC) Received: from [10.3.113.112] (ovpn-113-112.phx2.redhat.com [10.3.113.112]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2MFNYKp011741; Tue, 22 Mar 2016 11:23:34 -0400 Subject: Re: bug#23090: true and false not POSIX To: Ruediger Meier , Stephane Chazelas References: <201603221343.31030.sweet_f_a@gmx.de> <20160322134023.GA6518@chaz.gmail.com> <201603221539.52985.sweet_f_a@gmx.de> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg X-Enigmail-Draft-Status: N1110 Organization: Red Hat, Inc. Message-ID: <56F16376.7040205@redhat.com> Date: Tue, 22 Mar 2016 09:23:34 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <201603221539.52985.sweet_f_a@gmx.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="SwidMR6c1oL6jv3NgGjsXpbaMv9j5Bs5T" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 23090 Cc: 23090@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --SwidMR6c1oL6jv3NgGjsXpbaMv9j5Bs5T Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03/22/2016 08:39 AM, Ruediger Meier wrote: >> While I'd tend to agree it would be better if they didn't accept >> options as most other implementations don't, AFAIK, POSIX >> doesn't forbid "true" implementations to accept options or >> operands. >> >> What those "None" mean is that the behaviour is not >> specified would an application pass arguments to "true". >> >> It doesn't say for instance that if passed any argument, it >> should ignore them. >=20 > Ok, but it must not use STDOUT and it must return 0. > true --help may predict the future of the stars as long as it exits 0=20 > and does _not_ print anything.=20 >=20 >> A conforming application should not pass arguments to "true". >=20 > Why not? http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html > Guideline 3: > Each option name should be a single alphanumeric character (the alnum c= haracter classification) from the portable character set. The -W (capital= -W) option shall be reserved for vendor options. >=20 > Multi-digit options should not be allowed. On that grounds, ANY use of an option named '--help' is already unspecified behavior according to POSIX, because it is not a valid option name. So a POSIX-ly correct application should not be giving long options to any utility with any expectation of a particular behavior= =2E http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap01.html > OPTIONS > ... > Default Behavior: When this section is listed as "None.", it means that= the implementation need not support any options. Standard utilities that= do not accept options, but that do accept operands, shall recognize "--"= as a first argument to be discarded. >=20 > The requirement for recognizing "--" is because conforming applications= need a way to shield their operands from any arbitrary options that the = implementation may provide as an extension. For example, if the standard = utility foo is listed as taking no options, and the application needed to= give it a pathname with a leading , it could safely do it as: >=20 > foo -- -myfile >=20 > and avoid any problems with -m used as an extension. In other words, POSIX intentionally _allows_ 'true --help' to be an extension, and because it is an allowed extension, conforming applications must not assume that it behaves in any particular way. > You may add options as long as you don't violate the specification. > BTW coreutils "echo --help" is also wrong. Here POSIX explicitly=20 > says: "Implementations shall not support any options". No, 'echo' is a special case, and in this special case, coreutils' echo _is_ compliant with POSIX, when you set POSIXLY_CORRECT in the environmen= t. >=20 > BTW I know about POSIXLY_CORRECT env. I just ask this: Is it worth to=20 > violate parts of POSIX just for minor cosmetical reasons? We are NOT violating POSIX. You have yet to quote chapter and verse from POSIX pointing out something that coreutils is not already doing. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --SwidMR6c1oL6jv3NgGjsXpbaMv9j5Bs5T Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJW8WN2AAoJEKeha0olJ0Nq9GkH/1GwG9JpZnYEqo0rRB2ZSlF1 8AgJaBuyMqgYZudh8pil8t0sJ24TJ1Strjv1gyBdMjl+v0d/M64boFYjARaEebuc rg3x+JRV1VRLxa2HaR/LieNw8tp4/LxaZsw0hEqXdHEQIP3mDuStMWzWeUMHf4im IlasbEuRIcjs11bhZkG0uOBoWY7UyPhLIUDc/TTPoWhKAzNMXc91Fq8QGqaPKlL8 qDdpah4YKJCEv+Ifs7wiOjZ58icZTCv+7YhDL4THCp4CWd2OQH9sqBH4LBk3uvq3 5HPeqtYoCyt3vhroLIX6LTFUM9LFQilYruImO7+FckzwgvMbg06ykeCu3r+bDkU= =2w03 -----END PGP SIGNATURE----- --SwidMR6c1oL6jv3NgGjsXpbaMv9j5Bs5T-- From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 22 11:27:14 2016 Received: (at 23090) by debbugs.gnu.org; 22 Mar 2016 15:27:14 +0000 Received: from localhost ([127.0.0.1]:60143 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiODB-0005jB-Rd for submit@debbugs.gnu.org; Tue, 22 Mar 2016 11:27:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39817) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiOD9-0005j1-Pn for 23090@debbugs.gnu.org; Tue, 22 Mar 2016 11:27:12 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 3CC61486A4; Tue, 22 Mar 2016 15:27:08 +0000 (UTC) Received: from [10.3.113.112] (ovpn-113-112.phx2.redhat.com [10.3.113.112]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2MFR7Hm007506; Tue, 22 Mar 2016 11:27:07 -0400 Subject: Re: bug#23090: true and false not POSIX To: Stephane Chazelas , Ruediger Meier References: <201603221343.31030.sweet_f_a@gmx.de> <20160322134023.GA6518@chaz.gmail.com> <201603221539.52985.sweet_f_a@gmx.de> <20160322150828.GA4796@chaz.gmail.com> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: <56F1644B.6090303@redhat.com> Date: Tue, 22 Mar 2016 09:27:07 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160322150828.GA4796@chaz.gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4p3Pp9XfBt8gSxwcrhSg0a50FeNl2QxmI" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 23090 Cc: 23090@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --4p3Pp9XfBt8gSxwcrhSg0a50FeNl2QxmI Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03/22/2016 09:08 AM, Stephane Chazelas wrote: >> BTW I know about POSIXLY_CORRECT env. I just ask this: Is it worth to = >> violate parts of POSIX just for minor cosmetical reasons? >> >> I mean echo -n/-e may be an improvement though non-posix. But=20 >> echo --version is a violation just for cosmetics, true --version is=20 >> even worse. >=20 > AFAICT, echo --version is a violation, true --version is not. 'echo --version' is not a violation. POSIX says that you are allowed to require the user to set a particular environment variable to enter the POSIX-conformant setup; in GNU coreutils' case, that variable is POSIXLY_CORRECT. When set, coreutils' echo behaves exactly as POSIX requires. When not set, coreutils' echo behaves as GNU Coding Standards require. As the two standards conflict, we cannot do both behaviors at once; so the behavior of choice is determined by your environment variabl= es. In the case of 'true' and 'false', the two standards do not conflict, so we implement both of them at once without the need to resort to reading POSIXLY_CORRECT from the environment. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --4p3Pp9XfBt8gSxwcrhSg0a50FeNl2QxmI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJW8WRLAAoJEKeha0olJ0NqrP4H/2Pi0ITyPXMw4o77IqXNS9cT 6o9O0u1J7RhF8VFJwz7aCqcJUJ+/9SAoUTMkQFrnzdmRHhx7go4ZkpWMxfNL2w1K XjI0nhUWq8CnDR8aPWjERs4Bs9TlKgVzDFFIrfIENZHYlZKVCMLABiGXYDyD/KYf 4wUP/ncM+Fe/OyQB5oaj7pSxn2MUHlXmOxs7CEPtch3XKmJMjKxwPavknrxZ2nH/ pz40I05sGxA3kKkDYHJDFcSA4pVJMvZIuQiO8Cm0BAsQKuqIJM/FWfCSlVWPy9zr FvD/wLvx9KWI4YMeMHO1VNzdi9g2zzY1NnIsU1rpIT4t54heYIeBYw8L65XlK20= =tFNS -----END PGP SIGNATURE----- --4p3Pp9XfBt8gSxwcrhSg0a50FeNl2QxmI-- From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 22 11:31:05 2016 Received: (at 23090) by debbugs.gnu.org; 22 Mar 2016 15:31:05 +0000 Received: from localhost ([127.0.0.1]:60151 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiOGv-0005qZ-JQ for submit@debbugs.gnu.org; Tue, 22 Mar 2016 11:31:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50304) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiOGu-0005q5-NW for 23090@debbugs.gnu.org; Tue, 22 Mar 2016 11:31:05 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 56F006439B; Tue, 22 Mar 2016 15:30:59 +0000 (UTC) Received: from [10.3.113.112] (ovpn-113-112.phx2.redhat.com [10.3.113.112]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2MFUw4f010768; Tue, 22 Mar 2016 11:30:59 -0400 Subject: Re: bug#23090: true and false not POSIX To: Ruediger Meier , 23090@debbugs.gnu.org References: <201603221343.31030.sweet_f_a@gmx.de> <56F16124.8080704@redhat.com> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: <56F16532.4000807@redhat.com> Date: Tue, 22 Mar 2016 09:30:58 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <56F16124.8080704@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ss8TwCR5P2wHTpFgXVxCFppttlt71Skt9" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 22 Mar 2016 15:30:59 +0000 (UTC) X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 23090 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ss8TwCR5P2wHTpFgXVxCFppttlt71Skt9 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03/22/2016 09:13 AM, Eric Blake wrote: > On 03/22/2016 06:43 AM, Ruediger Meier wrote: >> Hi, >> >> Is there any good reason why coreutils true and false are not POSIX? >=20 > No, because coreutils' true and false ARE compliant with POSIX. >=20 >> But coreutils true has --version and --help implemented. It needs=20 >>> /dev/null redirection to work as expected. >=20 > Not true. POSIX says that behavior is unspecified for 'true --help'. > Therefore, whatever coreutils does in that case does not violate POSIX.= >=20 > 'true -- --help', on the other hand, must be silent - but coreutils > obeys that rule. Correction - POSIX says that 'true -- --help' is unspecified, so coreutils can do whatever it wants (and in that case, GNU coreutils opted to treat '--help' as an ignored operand, because the '--' ended the chance to treat it as an option). According to POSIX, the _only_ specified use of 'true' is without operand= s: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/true.html > SYNOPSIS >=20 > true Any other arguments on the command line are extensions, and can behave however the implementation wants; portable apps will not be invoking 'true' with arguments, because they are no longer getting behavior mandated by POSIX. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --ss8TwCR5P2wHTpFgXVxCFppttlt71Skt9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJW8WUyAAoJEKeha0olJ0Nqir0H/iBK3IzM60w2lP3NYOIjZMuz 0b+Da/QfJDWM6cipEV5YvEMm2O1i5LC8j2typFJKtXWz+lpKtlQUNQgsHNPVmagT QqpfzjJYrBQQRVq5G8Pq8qHtyAODL1AWexSmMj2QoY8LtSg5Z4LLa8Wj4Q2mjOaq +Ql/p0i9UCeXa0YQ4RxTi5uh/S13gBRDWwRo5QIJQd9VAwCw5+tLX/bHRVlz5KkR WKYkFFfabaw3h8N3JlkCTmn5AlPTzzlsC/tnzR5lkjytpKrr1Rt38JGB3G5oPC/t SAZpqDVrqlShW27ypm+YSaKp2vpOIFNrloeu5cholLuIwjKDbuDYNQ60NBMhJyI= =SltM -----END PGP SIGNATURE----- --ss8TwCR5P2wHTpFgXVxCFppttlt71Skt9-- From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 22 11:33:05 2016 Received: (at control) by debbugs.gnu.org; 22 Mar 2016 15:33:05 +0000 Received: from localhost ([127.0.0.1]:60160 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiOIq-0005u9-TE for submit@debbugs.gnu.org; Tue, 22 Mar 2016 11:33:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35891) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiOIp-0005u1-9q for control@debbugs.gnu.org; Tue, 22 Mar 2016 11:33:03 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id ECB21C00B8EE for ; Tue, 22 Mar 2016 15:33:02 +0000 (UTC) Received: from [10.3.113.112] (ovpn-113-112.phx2.redhat.com [10.3.113.112]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2MFX2xO012521 for ; Tue, 22 Mar 2016 11:33:02 -0400 Subject: Re: bug#23090: true and false not POSIX To: GNU bug control References: <201603221343.31030.sweet_f_a@gmx.de> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: <56F165AE.9060604@redhat.com> Date: Tue, 22 Mar 2016 09:33:02 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <201603221343.31030.sweet_f_a@gmx.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Xnt7PwxKljNj8WucIdaKRT0IlsoJXwave" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Xnt7PwxKljNj8WucIdaKRT0IlsoJXwave Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable tag 23090 notabug close 23090 thanks --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --Xnt7PwxKljNj8WucIdaKRT0IlsoJXwave Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJW8WWuAAoJEKeha0olJ0Nq2JcIAJFUBZegQiqZqkXqoIt9kA1x KFLj8duj4Nkv1Qy17wn/D3zAf5pGW/JSgE08G6Dz0YJv/DZv6BOeNWLbbRxWG7gt elz3op2oEPpmvK3BGujZzs2uZwSSQZoToPHAquvbq9t93P8shAezBa5D7i5x0Wat iIJCIl4weFIFyiIrZR/wLdmakf6CNi9FPrP1LHXJbAmeqaxsvKfO3sGlzHxAbO8q 3mdMTDHras31BeerQv00C4SpCiV50pxiRyIq7IosKVyMZ01Bmb58VrN9AtY/BaqD OKga2m+0YNlMG9xwmF4iXem+khnICiy3SrylD+1ZjXUexbgzv5NFUVXhz7UYMJc= =KoBA -----END PGP SIGNATURE----- --Xnt7PwxKljNj8WucIdaKRT0IlsoJXwave-- From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 22 12:38:45 2016 Received: (at submit) by debbugs.gnu.org; 22 Mar 2016 16:38:45 +0000 Received: from localhost ([127.0.0.1]:60209 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiPKP-0002Up-L2 for submit@debbugs.gnu.org; Tue, 22 Mar 2016 12:38:45 -0400 Received: from eggs.gnu.org ([208.118.235.92]:53760) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiPKO-0002Ud-Fw for submit@debbugs.gnu.org; Tue, 22 Mar 2016 12:38:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiPKE-0006Xi-By for submit@debbugs.gnu.org; Tue, 22 Mar 2016 12:38:39 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:42170) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiPKE-0006XW-94 for submit@debbugs.gnu.org; Tue, 22 Mar 2016 12:38:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44715) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiPKD-0000QO-6a for bug-coreutils@gnu.org; Tue, 22 Mar 2016 12:38:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiPKA-0006W1-0s for bug-coreutils@gnu.org; Tue, 22 Mar 2016 12:38:33 -0400 Received: from mout.gmx.net ([212.227.15.18]:59756) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiPK9-0006VJ-Nt for bug-coreutils@gnu.org; Tue, 22 Mar 2016 12:38:29 -0400 Received: from zappa.ga.local ([82.139.197.16]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0MTjqS-1aHuGC2thg-00QWJf for ; Tue, 22 Mar 2016 17:38:28 +0100 From: Ruediger Meier To: bug-coreutils@gnu.org Subject: Re: bug#23090: true and false not POSIX Date: Tue, 22 Mar 2016 17:38:27 +0100 User-Agent: KMail/1.9.10 References: <201603221343.31030.sweet_f_a@gmx.de> <56F16124.8080704@redhat.com> In-Reply-To: <56F16124.8080704@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201603221738.27573.sweet_f_a@gmx.de> X-Provags-ID: V03:K0:hYjM8uX2RRt6t9rnYIuI9n82kPkKpfa5XEnLYWgRcj0FFNC+FC5 vqZiFluNQk5QD/cOs4UQwMiCPiuCU2JYMMx/AGbWZk15rpmk9lzOo0I9CrBJUsITnrC3p6a dkyQIzXkxjaplf23WkGPD3pxLFCb6U2wtLqYHuSgYGdW5GItCy40ECI7sHeIssHwCVfY5qz xhTgU/7Rr51y1nOsdcDxA== X-UI-Out-Filterresults: notjunk:1;V01:K0:RfSp2gcbf58=:aph2e/26LsMiLGAt3dk18l PtqIUQCp7C3he8qtjk3eax+wli6hjPZxJZtYh4abQtVUwMdWoqjFez9NIyDXSY+3m/WaQLj48 cMQcND2ZUbw8j9fNQuVlJXifBMhB4mbJPSfKKUWmkLT9y2u5zR+o5/UVu8/hTROZDiKuV6unL 9u7GMDZCltdZQjYlrrpy6vOlwqsHEZChEAS7XHIqoWGFSJdqOwNvdbhdWxloOFphUKC1C56RU BCd0fN0ihYeR1KAxD8bTWHuqqn9bVvEStp30djM9kCGVTpmLhJxX4m/xsOTJ84oOWu/2LkrJz poRac8qBMbLf6uUWJoV3L1G61SprZiRTldOroLOYYFsYvdqIJOcHTL1fcu8x2M8FHb97psSq7 VRGaxZqEKP2v8mjOqSOBxnz/NpX4pCt8SmgRpfOVffC4mM04LsWUP8KAufvXSV33Wv1TSHbzC WeeyZ0ypCoC4+kL9gPtG3XQoFlMTVRkcGqZipIO68uOqkpuJfS1UHtxRia5Jel6HEBpFWUDfq +JKKRDF/WeA21x1m4Ip/hWXUWt8JUpmfCecAxtedPhcc4j+iPCZCZjOM3OwPGCDzcVvMz/XtC UaiTR/wSOXJHe4z4TlqssT6HJepDoresDe7TCj7PueqahPv1eHys6DKyHoXuqttAc1l5rT2tU MDUSAyIz60SeUT4lam6tKKpYNOq1q9B1CVmMiIh6jG0DinQjeLCP/cW2R4tGvzu3nUT9nG5yn H4B6C+GrAbWggVVztKyE9rHaRTSNiFbm+eH40jDbqsuopUZnz3TVzO3CuJ4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) On Tuesday 22 March 2016, Eric Blake wrote: > On 03/22/2016 06:43 AM, Ruediger Meier wrote: > > Hi, > > > > Is there any good reason why coreutils true and false are not > > POSIX? > > No, because coreutils' true and false ARE compliant with POSIX. > > > But coreutils true has --version and --help implemented. It needs > > > >> /dev/null redirection to work as expected. > > Not true. POSIX says that behavior is unspecified for 'true --help'. > Therefore, whatever coreutils does in that case does not violate > POSIX. I've seen many existing scripts where people do something like this: cmd=whatever # ignore if not exist type "$cmd" || cmd="true" [...] $cmd --something --we --want --to --do --if --possible [...] Similar use case would be to set cmd="echo debug whatever: ". You can't decline that you implicitly accept such usage, otherwise $ true --blabla would not return true (without error message) and $ false --help would not return false. These exit codes are not good GNU Coding Standards I guess. Also not non-getopt behavior like "echo string --help". > 'true -- --help', on the other hand, must be silent - but coreutils > obeys that rule. > > > Also these options are the reason why true.c is using many library > > functions like setlocale, etc. The binary is bloated and the risk > > that something goes wrong/crashs is much higher. I was looking for > > a minimal and rock-solid true command to be used in scripts. > > If coreutils' true crashes due to wrong file permissions causing > setlocale() to fail, your system is already going to have severe > problems with other utilities. Coreutils is complying with GNU > Coding Standards at the same time as POSIX, and we do not feel that > it is bloated for doing so. > > > IMO it is not worth to violate POSIX just because of cosmetical > > reasons (--help/--version). Moreover since the true command usually > > comes from the shell I guess that almost no person on earth ever > > had seen your nice --help output anyways. > > On many GNU/Linux systems, 'man true' displays the coreutils' man > page for true, which in turn was generated from 'true --help' output. > So a lot more people read it than you might think, even if they > don't directly invoke it. I'm sure that's possible to write manpages without --help ... BTW this man page does not match to the most probably used built-in command. This confuses the reader even more and is IMO another argument why coreutils shouldn't have added --help options for these kind of commands. cu, Rudi From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 22 12:39:50 2016 Received: (at submit) by debbugs.gnu.org; 22 Mar 2016 16:39:50 +0000 Received: from localhost ([127.0.0.1]:60217 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiPLS-0002Wm-6p for submit@debbugs.gnu.org; Tue, 22 Mar 2016 12:39:50 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54094) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiPLQ-0002WZ-V1 for submit@debbugs.gnu.org; Tue, 22 Mar 2016 12:39:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiPLL-0006tj-1m for submit@debbugs.gnu.org; Tue, 22 Mar 2016 12:39:43 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:34339) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiPLK-0006tc-Ui for submit@debbugs.gnu.org; Tue, 22 Mar 2016 12:39:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45059) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiPLJ-0001EF-TT for bug-coreutils@gnu.org; Tue, 22 Mar 2016 12:39:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiPLG-0006r3-Mh for bug-coreutils@gnu.org; Tue, 22 Mar 2016 12:39:41 -0400 Received: from mout.gmx.net ([212.227.17.21]:60706) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiPLG-0006qb-Cx for bug-coreutils@gnu.org; Tue, 22 Mar 2016 12:39:38 -0400 Received: from zappa.ga.local ([82.139.197.16]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0LZmd6-1a3omb3yea-00lV4w; Tue, 22 Mar 2016 17:39:22 +0100 From: Ruediger Meier To: bug-coreutils@gnu.org Subject: Re: bug#23090: true and false not POSIX Date: Tue, 22 Mar 2016 17:39:19 +0100 User-Agent: KMail/1.9.10 References: <201603221343.31030.sweet_f_a@gmx.de> <20160322150828.GA4796@chaz.gmail.com> <56F1644B.6090303@redhat.com> In-Reply-To: <56F1644B.6090303@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201603221739.19983.sweet_f_a@gmx.de> X-Provags-ID: V03:K0:7+TDqTcnWUBxRi5oS/+9O8+h0/25yqOd4Mix545lSDvcaYZv34n bxUNvUEkszDTDa/qG5Fgb40+3bDVtCYjFWsOsZGocPuqwFWfOd5zjudM6HePEaTiXdjdfxP 6Vq2fPQ9q6TjsUVQq6eBeodzFOHxEln7mUBIBzG9HCgoA8oLBvs24YtY9We0XEtEbz4gLGL cifN6RyJLR4YBUlOErVsA== X-UI-Out-Filterresults: notjunk:1;V01:K0:q+GPeiTiLb0=:j9oSZyLDq40yeelg23zLks /iMPB09PVhmnWA5JY2plO1CFvXc+qjO3cB/BUwUMzjFTM5owRrmST13Ghjg4Hqe9eb9/EMZ4j 30WZXoKVfxgndkkfanFzucXSacNwsJ6uXrTaljJ/bz0/40AMwVz3lmnDtMiXta5xZGHoXjlQm n8Tytck5L8+ntczvMjY81ji2PTdn9R7vRoG0sHUaXY4/gCQEVBbzA9h5XCV65KIxnC15np6y3 0IV0ilMGQgSps1/8OmkOrAwBuQxiNfGu3/msA0cjhHlrnCaMWEwMfvN6KnWgmQTllf81sz58G 4k6jbnkkb/MQ40DvWYpm7FToXG2IEDUBu0+V581pFKZUu+XVIQQc2Jf6ngn2I4YqPkbgH1GmI gBuwXXtw+m2GHW74MCjEDK69xBTLDWyuzWbeV6xKvRSt2owUmYdZAkv25k9zxg8fF4nEQgMxj r7aTrxOmlew2JJvVi+3bBxSTGHGi9HONhXMrefWltexLwqZhSDGReRDuPYUjhwoZ66zeieH1H FsYzTHM6UA7a+5tKB3zdqTsXCR0qE9E27i9jPTythUftVcaDHNnIjcfVpiDAmNIoGYMXNzQYU D2frUXN6wP6FxgYFAZMqH90YI4sEV3oToLWqAp0Lf64Vrdl1Dji7sc6eUf3Ev8Uop12UJegmR U78UxX7kC4/dD+PXA5UOkf4+DvWA/KK/em4mFeuZeT7YnF14NxaRy+ruIOBI8Nr+ctzbpN9g9 nQSBv8lDVoxo08OhSSOOQGnqUWvxoD1dmQSVZpr9McdMN8OBSUf/JbGyiCE= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit Cc: 23090@debbugs.gnu.org, Eric Blake , Stephane Chazelas X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) On Tuesday 22 March 2016, Eric Blake wrote: > On 03/22/2016 09:08 AM, Stephane Chazelas wrote: > >> BTW I know about POSIXLY_CORRECT env. I just ask this: Is it worth > >> to violate parts of POSIX just for minor cosmetical reasons? > >> > >> I mean echo -n/-e may be an improvement though non-posix. But > >> echo --version is a violation just for cosmetics, true --version > >> is even worse. > > > > AFAICT, echo --version is a violation, true --version is not. > > 'echo --version' is not a violation. POSIX says that you are allowed > to require the user to set a particular environment variable to enter > the POSIX-conformant setup; in GNU coreutils' case, that variable is > POSIXLY_CORRECT. When set, coreutils' echo behaves exactly as POSIX > requires. When not set, coreutils' echo behaves as GNU Coding > Standards require. As the two standards conflict, we cannot do both > behaviors at once; so the behavior of choice is determined by your > environment variables. > > In the case of 'true' and 'false', the two standards do not conflict, > so we implement both of them at once without the need to resort to > reading POSIXLY_CORRECT from the environment. You could also let true behave like rm if POSIXLY_CORRECT is not set or if more than zero option given. Does it make sense to change the behavior fundamentally? IMO bash for example does the most natural trade-off. They have -neE but nothing else. cu, Rudi From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 22 12:48:21 2016 Received: (at 23090) by debbugs.gnu.org; 22 Mar 2016 16:48:21 +0000 Received: from localhost ([127.0.0.1]:60227 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiPTh-0002je-AS for submit@debbugs.gnu.org; Tue, 22 Mar 2016 12:48:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49049) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiPTf-0002jW-JU for 23090@debbugs.gnu.org; Tue, 22 Mar 2016 12:48:20 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 81AB5804EF; Tue, 22 Mar 2016 16:48:18 +0000 (UTC) Received: from [10.3.113.112] (ovpn-113-112.phx2.redhat.com [10.3.113.112]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2MGmHw5016750; Tue, 22 Mar 2016 12:48:18 -0400 Subject: Re: bug#23090: true and false not POSIX To: Ruediger Meier , 23090@debbugs.gnu.org References: <201603221343.31030.sweet_f_a@gmx.de> <56F16124.8080704@redhat.com> <201603221738.27573.sweet_f_a@gmx.de> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg X-Enigmail-Draft-Status: N1110 Organization: Red Hat, Inc. Message-ID: <56F17750.8040700@redhat.com> Date: Tue, 22 Mar 2016 10:48:16 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <201603221738.27573.sweet_f_a@gmx.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1tvSBSoUVPkQ9SWkAjhqmAaTadqtNSnBI" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 23090 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --1tvSBSoUVPkQ9SWkAjhqmAaTadqtNSnBI Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03/22/2016 10:38 AM, Ruediger Meier wrote: > I've seen many existing scripts where people do something like this: >=20 > cmd=3Dwhatever > # ignore if not exist > type "$cmd" || cmd=3D"true" > [...] > $cmd --something --we --want --to --do --if --possible > [...] Such scripts are non-portable. They could use: type "$cmd" || cmd=3D: for more portability. It's not our fault that non-portable scripts exist= =2E > BTW this man page does not match to the most probably used built-in=20 > command. This confuses the reader even more and is IMO another argument= =20 > why coreutils shouldn't have added --help options for these kind of=20 > commands. The man page (and --help output) specifically state: NOTE: your shell may have its own version of true, which usually super=E2=80=90 sedes the version described here. Please refer to your shell's docu=E2=80=90 mentation for details about the options it supports. So far, you haven't identified anything that we need to change in behavior in either 'true' or 'false' (certainly not any changes required for POSIX compliance, although it appears you are now moving on to questioning our extension behavior when used in ways not mandated by POSIX). Therefore, I've taken the liberty of closing this bug report. But feel free to continue discussion, and if you can come up with a change that we _should_ make that won't disrupt existing clients, then we can reopen the bug to track that. Note that it is a high bar to change the behavior of something like 'true'. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --1tvSBSoUVPkQ9SWkAjhqmAaTadqtNSnBI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJW8XdQAAoJEKeha0olJ0NqM+IH/Aiffik5Tua3Dnsex6nZk18n HYAwp1RYDX5qXhgAP8K4Ocu18P4i4lU1szfBynVyd/h3hKZSasi1jKDXO+OgeU2X 5jd63fRHSSOGOQWFS9WHs51VmPAML/6ZTJGZEe+UTf1iVeZ2ZaEQjBCnhZlAuK5L 8Sfw9mPb6X5Yiez+iWXGEvTSZl33N6VnrIAcYyli0+cYEwQ3N5at9yJAdpohTJzx YswIXibMMhewpseLIjb6nVtrICu/YO1Z0e9iYtL5eNgKIH7/OSgPtrX6rKvHZ470 XTE4R7Iq5Ogln8gYWv05E3D1dZQehc+R5kMJS+xhoBA1D/Aw3IMOEtAhRrj/nTo= =QUFt -----END PGP SIGNATURE----- --1tvSBSoUVPkQ9SWkAjhqmAaTadqtNSnBI-- From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 22 13:56:46 2016 Received: (at submit) by debbugs.gnu.org; 22 Mar 2016 17:56:46 +0000 Received: from localhost ([127.0.0.1]:60292 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiQXt-0004LX-QL for submit@debbugs.gnu.org; Tue, 22 Mar 2016 13:56:45 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47312) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiQXt-0004LJ-1w for submit@debbugs.gnu.org; Tue, 22 Mar 2016 13:56:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiQXn-00028A-1h for submit@debbugs.gnu.org; Tue, 22 Mar 2016 13:56:39 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:50627) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiQXm-000286-Us for submit@debbugs.gnu.org; Tue, 22 Mar 2016 13:56:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiQXl-0000C8-Q5 for bug-coreutils@gnu.org; Tue, 22 Mar 2016 13:56:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiQXf-000277-Vx for bug-coreutils@gnu.org; Tue, 22 Mar 2016 13:56:37 -0400 Received: from mout.gmx.net ([212.227.17.22]:57428) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiQXf-00026w-Mr for bug-coreutils@gnu.org; Tue, 22 Mar 2016 13:56:31 -0400 Received: from zappa.ga.local ([82.139.197.16]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0LuwiT-1ZiWMU0sXB-01089S; Tue, 22 Mar 2016 18:56:19 +0100 From: Ruediger Meier To: bug-coreutils@gnu.org Subject: Re: bug#23090: true and false not POSIX Date: Tue, 22 Mar 2016 18:56:17 +0100 User-Agent: KMail/1.9.10 References: <201603221343.31030.sweet_f_a@gmx.de> <201603221738.27573.sweet_f_a@gmx.de> <56F17750.8040700@redhat.com> In-Reply-To: <56F17750.8040700@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <201603221856.17836.sweet_f_a@gmx.de> X-Provags-ID: V03:K0:hLPzVZGd4QX0ckgfayDX3pNEeop/MbFr4UapJo2k/zXDdQ+WBep NyED9FCNULCXKnhfWbsylRXXvur+n8gjr1m+bWwcQYi/wan3TiNMsZwGUdDx+yR3S7deCaP qnj/KY17UeSSq0aUy+2pQA9/8tl25ATFNpqy448ZAwIOM3ZKWS+Yt8bSgI12SdvfDIkZTNy v1wMdw6JfbChdxyYo7vVQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:euKAs4aSe0E=:9h0r5QssUJNLoj+7b48ZMt fm8aIptalbjZKPEpUU+dWC9ubxZF5K+bezoQQmeAMGPNkF8g437PJz1ay3R4Hzy5o4pLkEdDx gYLkBulE9cegf7/SFD3x3lhNpm1S8cxcKCdyxUYY17fpQwF/4nLdo+Uv9savyJfP7fH5AYiL3 46zrTePq/SLScGmACgzejInCFcsr5rEr+/6Lve0tpjsoXbQ/7KHIbZjevY9wmJe9WrXdw+n2p jhEFCg3dBc8QBSse0LQ0TQmZyTqvySs344DcdIolK0sUuVxkgNVUpO0opV0qxCmzjpXjL+CCH J2A30iZKSfPxkakb4WQeYx/cxfCr9YiTs5Q165SK5p24AecBdNJ0PPo4/80ZKdazJ0oYompzY eo3MA3wj8f1YmW1Atj8Eg/F4lTuVE5jIlSieDrrT26YX3xhwSnUSFKg2aWqw5ysjtJau9z5hn 9YyNxBgWW7IxWVHg6+vc8LDAajmBToWM7QYS2BjxE+/hVxp+/Z07VDFcdHtBVhaeRjbyKf7Rq 8LMJCxlforeC+goeIEJqaw1keXQvwUhFFaopfPvlhP+aPs6msQni0dT/7RHpcPZknN41NUr82 wI+iiEqSSZ6PuxSxPu5UppOp+UW4povl1JMDgYPsmVULYVg3EHtcH0+zJP7UFMMWb0I6citEC yC/8/UgUi1c5np6qO89x+n/+jNZl56hyzqqpxmagk3x3ltxa8ut36aglVr0GYKgkn+Fc2hA1C eLKc9dJFK6WVdtn13KWROjr9gD/djqOrSQ1kecOnJpbkzB93gF3XoeECdeg= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit Cc: 23090@debbugs.gnu.org, Eric Blake X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) On Tuesday 22 March 2016, Eric Blake wrote: > On 03/22/2016 10:38 AM, Ruediger Meier wrote: > > BTW this man page does not match to the most probably used built-in > > command. This confuses the reader even more and is IMO another > > argument why coreutils shouldn't have added --help options for > > these kind of commands. > > The man page (and --help output) specifically state: > > NOTE: your shell may have its own version of true, which > usually super=E2=80=90 > sedes the version described here. Please refer to your=20 > shell's docu=E2=80=90 > mentation for details about the options it supports. I knew this note. However in the real world it simply does not make=20 sense to get a man page about something which is not used usually. > So far, you haven't identified anything that we need to change in > behavior in either 'true' or 'false' (certainly not any changes > required for POSIX compliance, although it appears you are now moving > on to questioning our extension behavior when used in ways not > mandated by POSIX). Therefore, I've taken the liberty of closing > this bug report. But feel free to continue discussion, and if you can > come up with a change that we _should_ make that won't disrupt > existing clients, then we can reopen the bug to track that. Note > that it is a high bar to change the behavior of something like > 'true'. I suggest an enhancement for portability and implementation simplicity=20 to remove the options --version and --help from true, false echo and [. It's a problem that the most used implementations (POSIX or built-ins)=20 behave differently and users might not be aware this fact when they use=20 the coreutils implementations by mistake or on purpose. Since the use=20 cases when somebody really needs a true, false or echo _binary_ are=20 rare, the probabilty is high that the user assumes well known behavior. The GNU coding style which requires these options is already violated=20 for the test command. It's pedantic to require POSIXLY_CORRECT to=20 disable such cosmetical options (case echo). This behavior enhancment would imply an implementation enhancement for=20 true and false because we could remove any locale and environment=20 checks. One use case for a simple true _binary_ is for example to test=20 other command (like setarch, gdb, strace, exec) if they work correctly=20 on their system. All this complicated code in true makes it more=20 unusable for such cases and people have to compile their own main=20 function which returns 0. cu, Rudi From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 22 14:01:16 2016 Received: (at submit) by debbugs.gnu.org; 22 Mar 2016 18:01:17 +0000 Received: from localhost ([127.0.0.1]:60303 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiQcG-0004Tk-J6 for submit@debbugs.gnu.org; Tue, 22 Mar 2016 14:01:16 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48569) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiQcE-0004TX-DG for submit@debbugs.gnu.org; Tue, 22 Mar 2016 14:01:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiQc5-0003Cp-TD for submit@debbugs.gnu.org; Tue, 22 Mar 2016 14:01:09 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:56684) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiQc5-0003Ci-QI for submit@debbugs.gnu.org; Tue, 22 Mar 2016 14:01:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiQc0-0002mF-4c for bug-coreutils@gnu.org; Tue, 22 Mar 2016 14:01:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiQbw-0003Bi-Q5 for bug-coreutils@gnu.org; Tue, 22 Mar 2016 14:01:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42752) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiQbw-0003BV-Ju for bug-coreutils@gnu.org; Tue, 22 Mar 2016 14:00:56 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 0A32146210; Tue, 22 Mar 2016 18:00:55 +0000 (UTC) Received: from [10.3.113.112] (ovpn-113-112.phx2.redhat.com [10.3.113.112]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2MI0tf2006041; Tue, 22 Mar 2016 14:00:55 -0400 Subject: Re: bug#23090: true and false not POSIX To: Ruediger Meier , bug-coreutils@gnu.org References: <201603221343.31030.sweet_f_a@gmx.de> <201603221738.27573.sweet_f_a@gmx.de> <56F17750.8040700@redhat.com> <201603221856.17836.sweet_f_a@gmx.de> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: <56F18857.1090109@redhat.com> Date: Tue, 22 Mar 2016 12:00:55 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <201603221856.17836.sweet_f_a@gmx.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="J5QOHCIJEigpON4ePUQIMBrktgjS4EboB" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit Cc: 23090@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --J5QOHCIJEigpON4ePUQIMBrktgjS4EboB Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03/22/2016 11:56 AM, Ruediger Meier wrote: >> The man page (and --help output) specifically state: >> >> NOTE: your shell may have its own version of true, which >> usually super=E2=80=90 >> sedes the version described here. Please refer to your=20 >> shell's docu=E2=80=90 >> mentation for details about the options it supports. >=20 > I knew this note. However in the real world it simply does not make=20 > sense to get a man page about something which is not used usually. It's not coreutils' fault if distros don't know how to make 'man true' redirect to the shell's man page. > I suggest an enhancement for portability and implementation simplicity = > to remove the options --version and --help from true, false echo and [.= Sorry, but that would violate GNU Coding Standards, so we aren't going to do it. >=20 > It's a problem that the most used implementations (POSIX or built-ins) = > behave differently and users might not be aware this fact when they use= =20 > the coreutils implementations by mistake or on purpose. Since the use=20 > cases when somebody really needs a true, false or echo _binary_ are=20 > rare, the probabilty is high that the user assumes well known behavior.= The probability that someone knows well-known GCS behavior of '--help' working are also high. At this point, the change would be more disruptive than keeping the status quo. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --J5QOHCIJEigpON4ePUQIMBrktgjS4EboB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJW8YhXAAoJEKeha0olJ0NqtFcIAIqX6JHdiWP7/GnE1Twbj2ut j/XaelvjtwRPYe+J+Od1ogthfvjS0l1pZv/KNLAZ5QHt8EZXQ2OSuFjDBrWRj2cr gwSa6iND6cmf7Cba9i1dM/2025TSGIoRL+0T7rDoE9zyg6oUxd28vaDnDolz5Wri 0/4czrOt2zNC+tRIynSUNx3OK8J0hIORHQ1z4E5GcY3jv/tsf+fG743nAPW0GSuS aECBG5152atuIgMr4JqGnn2REGrkst4dELFo9Tvq+rLHRPNnBD6tSnB310pwly6K CtGFLQsc5iXivpgENF0OuM/C1ygN7QT+iJkMMBjtE4QLXPEqyfOx1V3YNeeQ2Ws= =z2DB -----END PGP SIGNATURE----- --J5QOHCIJEigpON4ePUQIMBrktgjS4EboB-- From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 22 14:35:55 2016 Received: (at 23090) by debbugs.gnu.org; 22 Mar 2016 18:35:55 +0000 Received: from localhost ([127.0.0.1]:60349 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiR9n-0005IO-1i for submit@debbugs.gnu.org; Tue, 22 Mar 2016 14:35:55 -0400 Received: from mout.gmx.net ([212.227.15.19]:62598) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiR9k-0005I9-Kq for 23090@debbugs.gnu.org; Tue, 22 Mar 2016 14:35:53 -0400 Received: from zappa.ga.local ([82.139.197.16]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0LedVG-1Zzmip2h0Y-00qQsH; Tue, 22 Mar 2016 19:35:41 +0100 From: Ruediger Meier To: Eric Blake Subject: Re: bug#23090: true and false not POSIX Date: Tue, 22 Mar 2016 19:35:39 +0100 User-Agent: KMail/1.9.10 References: <201603221343.31030.sweet_f_a@gmx.de> <201603221856.17836.sweet_f_a@gmx.de> <56F18857.1090109@redhat.com> In-Reply-To: <56F18857.1090109@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <201603221935.39333.sweet_f_a@gmx.de> X-Provags-ID: V03:K0:LML6xgSLfR8+NPzUCr4TgO10rmWcRgvRkyJNoU6xu6doJE5YNaO nG5m7usBVuntnrBfOvQ4/9Vhnuk9CluSCUMTbtKdIG1LcPfRlzRI3Dm1BDi1C+N6dtNb1ln znT94GFifN+IbJejYoSV7NDvch4SldoXXMTnluwDaXcIel0QT1TaWr6MFcqgXuYAWBBtDY5 cZGKn+VO2I2z9DQRH/EFQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:0vBP2zFAwHs=:WI8xR8zdKIAk0BZr+mv4Ib MqP8C49S6gQieM9+mkJhi8mI8tduczBe2bnYOIERrBx38/TwIFKQcN6Wv1/Cst+kLY097/tlj MvkcpiMizDyoXUbMxk4vTvBs0TzSKT3uEu0BF4RykJM8ckbo5z7w/dstLo9eYgIjruUfkTIsu O5OvlbogfqLoNclOIVxdGIZg93nv3V5gcFtvxhcZKVM1qrS1DVGU96Y6JhWwJsWqBKLzGa/aM Momy1ZuIwVv4RSY9xUra4fN8cSEIL6x1hJADuYRcOs7D4kqNrhrFMzWscTT21qzQSmB/xK14B fylgXryFn3QbUKW0Bad3G8A5gMf/qnI4D9PlcY/hwWijTz+HRK9vsiNjsTJbG+Kk+iDKbvToc SSXR8vV5gX6/paWAcx5GdReXCGlBuYG6T3i4gp8HaxNPrJPLuPTJqdT7N5nrQO/lOJiK/lF3v JH+/0TzsDvfw+z37aTPfp/mcgj743T022lRECW+CMPt9xShF1znGfQz21wyqpQAKgqn9jUQUy eLtGDcnFs5H3tcmIfP2SBO5rFLJ9dYlAmIGPUGKrQRCOT8sOoxezIvmoxVEhynYqiUNeuXJwn 4ewCEi80iKGfRV0u7FFBhWeHEU7hbsdTwr8u0KV0ny9TsQun/7Tn8juMC2DLm1sD/5xLRgAuA BklA9Zsco2T8+YYtBdFhUdN0onelNTxWSu9HDcRjPgzXv5FCIEUrc92wSkkjJQELDh3p2Rw2U dpsd4tlIhv5B1/iPPIlYPPce6mjyF/KSx/x5yrdl9XhDJJ07QFMZcVcEklM= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23090 Cc: 23090@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Tuesday 22 March 2016, Eric Blake wrote: > On 03/22/2016 11:56 AM, Ruediger Meier wrote: > >> The man page (and --help output) specifically state: > >> > >> NOTE: your shell may have its own version of true, which > >> usually super=E2=80=90 > >> sedes the version described here. Please refer to your > >> shell's docu=E2=80=90 > >> mentation for details about the options it supports. > > > > I knew this note. However in the real world it simply does not make > > sense to get a man page about something which is not used usually. > > It's not coreutils' fault if distros don't know how to make 'man > true' redirect to the shell's man page. > > > I suggest an enhancement for portability and implementation > > simplicity to remove the options --version and --help from true, > > false echo and [. > > Sorry, but that would violate GNU Coding Standards, so we aren't > going to do it. So then test --help is a coreutils bug because it does not respect GNU=20 Coding Standard? As already said the exit codes are for sure not=20 GNU-style too. What about changing GNU Coding Standards to allow to break them if they=20 don't make any sense like in this case? > > It's a problem that the most used implementations (POSIX or > > built-ins) behave differently and users might not be aware this > > fact when they use the coreutils implementations by mistake or on > > purpose. Since the use cases when somebody really needs a true, > > false or echo _binary_ are rare, the probabilty is high that the > > user assumes well known behavior. > > The probability that someone knows well-known GCS behavior of > '--help' working are also high. At this point, the change would be > more disruptive than keeping the status quo. Yep one might use it in scripts wrongly: /bin/false --version &>/dev/null || echo "cant determine version" or right: if test -n "$(/usr/bin/true --help)"; then rm -f /usr/bin/true echo 'int main(int argc, char **argv){return 0;}'> /tmp/true.c cc /tmp/true.c -o /usr/bin/true fi cu, Rudi From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 22 14:57:02 2016 Received: (at 23090) by debbugs.gnu.org; 22 Mar 2016 18:57:02 +0000 Received: from localhost ([127.0.0.1]:60397 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiRUE-0007Tj-6u for submit@debbugs.gnu.org; Tue, 22 Mar 2016 14:57:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42972) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiRUC-0007TU-9P for 23090@debbugs.gnu.org; Tue, 22 Mar 2016 14:57:00 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 7A641711CA; Tue, 22 Mar 2016 18:56:59 +0000 (UTC) Received: from [10.3.113.112] (ovpn-113-112.phx2.redhat.com [10.3.113.112]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2MIuwMV015054; Tue, 22 Mar 2016 14:56:59 -0400 Subject: Re: bug#23090: true and false not POSIX To: Ruediger Meier References: <201603221343.31030.sweet_f_a@gmx.de> <201603221856.17836.sweet_f_a@gmx.de> <56F18857.1090109@redhat.com> <201603221935.39333.sweet_f_a@gmx.de> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: <56F1957A.3070708@redhat.com> Date: Tue, 22 Mar 2016 12:56:58 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <201603221935.39333.sweet_f_a@gmx.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ESiL3tp1gkGt8waRiSseu29M15IT9tjMv" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 22 Mar 2016 18:56:59 +0000 (UTC) X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 23090 Cc: 23090@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ESiL3tp1gkGt8waRiSseu29M15IT9tjMv Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03/22/2016 12:35 PM, Ruediger Meier wrote: >>> I suggest an enhancement for portability and implementation >>> simplicity to remove the options --version and --help from true, >>> false echo and [. >> >> Sorry, but that would violate GNU Coding Standards, so we aren't >> going to do it. >=20 > So then test --help is a coreutils bug because it does not respect GNU = > Coding Standard? As already said the exit codes are for sure not=20 > GNU-style too. No, 'test --help' is a special case where we follow the POSIX rules always, because we have '[ --help' in its place for when we want to expose the GNU capabilities of the same .c file. >=20 > What about changing GNU Coding Standards to allow to break them if they= =20 > don't make any sense like in this case? You're welcome to propose a change to the standards; but they are not maintained on this list; see bug-standards@gnu.org If you get that change approved by rms, then we'll adjust coreutils to match. But rms will probably ask for the coreutils' maintainers' opinion before approving such a change, so it will be an uphill battle on your side. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --ESiL3tp1gkGt8waRiSseu29M15IT9tjMv Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJW8ZV6AAoJEKeha0olJ0NqUsgH/jsJIvSV+ZBDA1qtc5fGzFgT bWgtU45zr+VRlU5sayCs2N3Dy4O8TQQQ0JQ+PRTDAYgfvYFA8elWhKqma79UpY3R nMPeKzji2TQLQw4HK4fDY+1izBuyR3LlstiIbbPQe9BDFwODpXQQAMLegTfTiizT 690oBB2CxCQxjrDnvA6DyNpOsUesqIIvuca6Ccx2NMqgfsCavI0+d4xIqZdYmOio Y1IQaapwh5+5Cd+4MK/ECPREDUgIwnfVqT+8FAnmsUKgOLrR5SZhfY5FjNrvsb69 R7vCn5wcNf1tPC8sMQMgUuZpfxDRE45is/vM1l5GC9xa9OjiUPP+2i/mPJ7v60w= =0er5 -----END PGP SIGNATURE----- --ESiL3tp1gkGt8waRiSseu29M15IT9tjMv-- From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 22 15:31:58 2016 Received: (at 23090) by debbugs.gnu.org; 22 Mar 2016 19:31:58 +0000 Received: from localhost ([127.0.0.1]:60442 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiS22-0001Yd-4P for submit@debbugs.gnu.org; Tue, 22 Mar 2016 15:31:58 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:43568) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiS20-0001YR-MW for 23090@debbugs.gnu.org; Tue, 22 Mar 2016 15:31:57 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 0AF76161232; Tue, 22 Mar 2016 12:31:51 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id hljH9uG5ntFD; Tue, 22 Mar 2016 12:31:50 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 54E7A161234; Tue, 22 Mar 2016 12:31:50 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id IivNyc0-Wow9; Tue, 22 Mar 2016 12:31:50 -0700 (PDT) Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 3C83B161232; Tue, 22 Mar 2016 12:31:50 -0700 (PDT) Subject: Re: bug#23090: true and false not POSIX To: Ruediger Meier , 23090@debbugs.gnu.org References: <201603221343.31030.sweet_f_a@gmx.de> <20160322150828.GA4796@chaz.gmail.com> <56F1644B.6090303@redhat.com> <201603221739.19983.sweet_f_a@gmx.de> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <56F19DA6.7060604@cs.ucla.edu> Date: Tue, 22 Mar 2016 12:31:50 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <201603221739.19983.sweet_f_a@gmx.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 23090 Cc: stephane.chazelas@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On 03/22/2016 09:39 AM, Ruediger Meier wrote: > You could also let true behave like rm if POSIXLY_CORRECT is not set or > if more than zero option given. This misunderstands the intent of POSIXLY_CORRECT. Setting POSIXLY_CORRECT does not mean "remove all extensions not specified by POSIX". It merely means "conform to POSIX even where the default is to not conform". It might be helpful to have some other environment variable that meant "try to be strict about supporting only behavior required by POSIX", as one could use that to develop shell scripts that were more portable. However, that would be a lot of work to implement, and it's not clear it's worth the hassle to develop, maintain, and document. Plus, POSIX does not always specify behavior, so portability wouldn't be guaranteed by this. From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 22 16:19:46 2016 Received: (at 23090) by debbugs.gnu.org; 22 Mar 2016 20:19:46 +0000 Received: from localhost ([127.0.0.1]:60482 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiSmI-0002nP-9P for submit@debbugs.gnu.org; Tue, 22 Mar 2016 16:19:46 -0400 Received: from mail-wm0-f45.google.com ([74.125.82.45]:33424) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiSmG-0002nD-Sj for 23090@debbugs.gnu.org; Tue, 22 Mar 2016 16:19:45 -0400 Received: by mail-wm0-f45.google.com with SMTP id l68so208029986wml.0 for <23090@debbugs.gnu.org>; Tue, 22 Mar 2016 13:19:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=uVczO+7Pgs3PXqltbTZa999APT/v0WQYg04LVIreuU0=; b=crLqpB+dKPBpizdJbfjZzcD8tGBSzgvSu7dd5xXhqWtr8kdUza2io3AqDJBbLczXfV BrWefvEuQ+A/QyouZ//jFwK/EQuq85oXl5XtZXhJJewjiDvDJQ50kCLqH9dqw4HL4PUr vxtE04G/Wns/te0Xx0yHDdmUSpCcH+C6Tqk82IycRIYLBF7jx6A07FvBNb+U82Qvga/Q Nvm2pb/YLQWN3jiMw/YkE7LSR2XRASfCtFcsDCzVUogiJRK2fkZmqElpdZps49yyicyg O/ln+l8QSJCjoOafg9nlOIRDg4BnnXIw/JMhA4hAsBGZqsWPq+Z3aJv++WXI+7zLAVja cyLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=uVczO+7Pgs3PXqltbTZa999APT/v0WQYg04LVIreuU0=; b=X25IWUDyqMRyUoVDExbyFVCRmJ2oLuph2BYEUByOv2q6nw3QymHz0FA39XEXmGufwx Iw+Ap2z1Vsy+CTG/4muqoP/Cuw8WO1kNXAOi7HIhLFZbJ85eo6mecXRUDzotoVGswVBA lslbPe3nVXIS7nmsKgwOwSoJan+zqbBTNY7IApSsNpMiWxw/B/kgE2/Kl97hvu6X1Shu 1TwuLygbqxCauepxlLolTKZn9MSo5+izQGbGCydBR+DqE7faA4zWmAfd5ZN+Tj+NMOW2 IcQNGk1NAOZtlOeUzM1nDMWItjsMFVtNOhjLA33NeMMKHcTn6fQFWfKd/0Q2jZXAU0xS CbmQ== X-Gm-Message-State: AD7BkJIi+XyFOpmlQcdTsZ6tlxf3SuC19wr8MXIjle45147QAAp2UiadMhGo52dnkh0rDg== X-Received: by 10.28.13.79 with SMTP id 76mr23314959wmn.5.1458677979365; Tue, 22 Mar 2016 13:19:39 -0700 (PDT) Received: from chaz.gmail.com (05449dd5.skybroadband.com. [5.68.157.213]) by smtp.gmail.com with ESMTPSA id 198sm18956778wml.22.2016.03.22.13.19.37 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 Mar 2016 13:19:38 -0700 (PDT) Date: Tue, 22 Mar 2016 20:19:37 +0000 From: Stephane CHAZELAS To: Paul Eggert Subject: Re: bug#23090: true and false not POSIX Message-ID: <20160322201936.GB4796@chaz.gmail.com> References: <201603221343.31030.sweet_f_a@gmx.de> <20160322150828.GA4796@chaz.gmail.com> <56F1644B.6090303@redhat.com> <201603221739.19983.sweet_f_a@gmx.de> <56F19DA6.7060604@cs.ucla.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56F19DA6.7060604@cs.ucla.edu> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23090 Cc: Ruediger Meier , 23090@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 2016-03-22 12:31:50 -0700, Paul Eggert: [...] > It might be helpful to have some other environment variable that > meant "try to be strict about supporting only behavior required by > POSIX", as one could use that to develop shell scripts that were > more portable. However, that would be a lot of work to implement, > and it's not clear it's worth the hassle to develop, maintain, and > document. Plus, POSIX does not always specify behavior, so > portability wouldn't be guaranteed by this. But then in that environment, true --help would report an error: true: no argument allowed and exit with a non-zero exit status like when other non-POSIX extensions are not supported. It wouldn't make true more POSIX conformant but it would help people write POSIX scripts by telling them the feature they rely on (true ignoring arguments) is not standard. The OP's request was primarily about increasing portability with other true implementation where in "true --help", the "--help" argument is ignored. I agree POSIX true doesn't accept arguments, but before GNU "true" started accepting --help, --version, you could do portably (if not standardly): true "$args" to be ignored -- Stephane From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 22 17:14:50 2016 Received: (at 23090) by debbugs.gnu.org; 22 Mar 2016 21:14:50 +0000 Received: from localhost ([127.0.0.1]:60497 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiTdZ-0004IK-Sz for submit@debbugs.gnu.org; Tue, 22 Mar 2016 17:14:50 -0400 Received: from mout.gmx.net ([212.227.15.19]:62044) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiTdY-0004I7-9D for 23090@debbugs.gnu.org; Tue, 22 Mar 2016 17:14:48 -0400 Received: from zappa.ga.local ([82.139.197.16]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0LwIuc-1ZiDUK0c9u-01862G for <23090@debbugs.gnu.org>; Tue, 22 Mar 2016 22:14:42 +0100 From: Ruediger Meier To: 23090@debbugs.gnu.org Subject: Re: bug#23090: true and false not POSIX Date: Tue, 22 Mar 2016 22:14:40 +0100 User-Agent: KMail/1.9.10 References: <201603221343.31030.sweet_f_a@gmx.de> <56F19DA6.7060604@cs.ucla.edu> <20160322201936.GB4796@chaz.gmail.com> In-Reply-To: <20160322201936.GB4796@chaz.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201603222214.40822.sweet_f_a@gmx.de> X-Provags-ID: V03:K0:baetT/whapSG9XvQTfghq/La56u9MGe4Fg/NpdTEan9QuZJSzv1 8eSXXcX7+Ke0hm0VnS81cSCMRbFGYslihtxots3ic/dI6OjsQEitcI6K7ED6QzYUJ++QWwY PasW2TdcqU1wzPxXBAs/P7Z1K87q8Y/gHi/Ui8TP+AynQu4gVapEA6nnG/YKLVpV1qu+tex 40T36VqCOM8R0d4PXG+TQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:rM1lHo83128=:7PgCkRV4BIQG5mqZsaWA+8 NstaIr1owqABfbVMLzX3LFkJ9L2/viLGcQnyNo92bpi1JHLYecGqS0DXuodJML+MwbgdYr5QX SeP/SM1kEJuW5oESRlWeSa8x09wdK8XarkawgGp0IlPueI544M1Qqdk9BpcOiEAz1F7TL8Pl9 dRddO+UFNdMU692H+3N0672GzJI5sl6T5VNV5Vq2rghowVUOAMcQF8D7el9zUASK0yZYwtJ9S gAaOD0KJn/MI3uvnIEpCmGMvgufqSmPHovwJ5Y7UwypfM0pmPfYAHn8vWFdGNish4dr5lL7jM 4cvIl5qxyylCnAPhv1c39/xUL+ms5aiYnSEn7LjJIr5eJIpKFVre/sZlYVOE5TGpK+t+/3Agz zXhkdf/9R6ELiIVz5zzkxWYRXGkWCs/JM2gtsxZrUJ/25ci/J1gEXudYh0wdcim9ejs9qTk6o ta4/20wtKwIyJUPpurvJu7IRaB/SHQ1Z3p6/PxfdpvzUmpy3xe+iP3hVdfdCxKY2O9A6I1naR uB32md5wKuBfrpa+crTQ2TKbHlAgHHPl77WdUl+qeaEDPELQNdM4Kls4c3cMszIaHRv33Hq13 WaulenaPWa0h5Ol0hVfSKyhl1w3i5L40zrR/zDaH0BpYKPXVzoPdR5mkDpoqqYWk9i8TLL1zK +EFH6BqoXyCyu9P6B42Wu9raoAmrQRCxPeDYyQ6D3hNoxyCAhNiL+y1I9ssE9CZ0JJRHEZMXq 94h8fhQYfnHgxAzaS4aXavT3gXh0JdnMihGtPXk6CQqyJIhghu7MON9nmZk= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23090 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Tuesday 22 March 2016, Stephane CHAZELAS wrote: > 2016-03-22 12:31:50 -0700, Paul Eggert: > [...] > > > It might be helpful to have some other environment variable that > > meant "try to be strict about supporting only behavior required by > > POSIX", as one could use that to develop shell scripts that were > > more portable. However, that would be a lot of work to implement, > > and it's not clear it's worth the hassle to develop, maintain, and > > document. Plus, POSIX does not always specify behavior, so > > portability wouldn't be guaranteed by this. > > But then in that environment, true --help would report an error: > > true: no argument allowed > > and exit with a non-zero exit status like when other non-POSIX > extensions are not supported. It wouldn't make true more POSIX > conformant but it would help people write POSIX scripts by > telling them the feature they rely on (true ignoring arguments) > is not standard. > > The OP's request was primarily about increasing portability with > other true implementation where in "true --help", the "--help" > argument is ignored. > > I agree POSIX true doesn't accept arguments, but before GNU > "true" started accepting --help, --version, you could do > portably (if not standardly): > true "$args" to be ignored Frankly the only sane implementation of true(1) is IMO a main function which does nothing but return 0. Actually I was shocked then I saw coreutil's true.c today. Why on earth would somebody use getopt and locale machinery to implement the POSIX specification of true? Anyways I give up, GNU-Style-Conventions seem to be much stronger than any common sense. Don't get me wrong I really like --help and --version for real programs and I respect that coreutils did a good job to add these options strictly to all their progs. But for true and false? How could the true's version be interesting for somebody since there does only one sane true.c exist? PS actually my personal issue with true is not really that I want to use it with options. I was simply looking for a minmal binary, available on any systems. Unfortunately true is not and will never be. cu, Rudi From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 22 18:53:50 2016 Received: (at 23090) by debbugs.gnu.org; 22 Mar 2016 22:53:50 +0000 Received: from localhost ([127.0.0.1]:60556 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiVBO-0008O5-Ec for submit@debbugs.gnu.org; Tue, 22 Mar 2016 18:53:50 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:62770) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aiVBM-0008Nt-Cf for 23090@debbugs.gnu.org; Tue, 22 Mar 2016 18:53:48 -0400 Received: from [192.168.101.10] ([217.86.86.16]) by mrelayeu.kundenserver.de (mreue004) with ESMTPSA (Nemesis) id 0McAfD-1aSCww1Ozf-00JcAw; Tue, 22 Mar 2016 23:53:37 +0100 Subject: Re: bug#23090: true and false not POSIX To: Ruediger Meier , Eric Blake References: <201603221343.31030.sweet_f_a@gmx.de> <201603221856.17836.sweet_f_a@gmx.de> <56F18857.1090109@redhat.com> <201603221935.39333.sweet_f_a@gmx.de> From: Bernhard Voelker Message-ID: <56F1CCF0.2010608@bernhard-voelker.de> Date: Tue, 22 Mar 2016 23:53:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <201603221935.39333.sweet_f_a@gmx.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:ypYuHItKyZhu2Fx+HzhDxxmeztnBqVBcL0ZXJwjsGF2gVlrArlJ wvoLHq0Kna8qDW6d8AbPseuIDt3vksz7IKCOzyt57nlm2HaoATOQGeQFgpjk06PEuGh2O4C UQq9A/iHdWXtjml6opVqQo2t6XGWcV3NzRWRK2blM45HGCUhOK6FJAvIZGMbrrbkIq0zDjF uQAKtj+N7ifUNlQuIwLww== X-UI-Out-Filterresults: notjunk:1;V01:K0:oafpe0wOByk=:gVC9F+A0dFdlX2nUbdqxXn xF+TqhfDBZQQWvJHKSPmiNBFkkDTRmdynpDfqEBL09IIPqndvOeE/oSpcwmFOcvG05u+1I2FB rJvIiHGO9OvUMgcHvd8TqyQlzKpJEwuTVH2gZBIWILuqC1M0l92NGRaNJl9TwL/9DcIg0jyf8 za2N8peVrCwKNGpeLbgMb11sXKuf9jeeKNeiM3lJJWXAT/yKrCduReAj/1LHqqhBw+m75nL0o gLsxQU7OYwHwsan9Jl5ADBKQ1LURr7CtFOj2DM2jISE6gh+toNiJdShLGczSzmVphLdswIlkH bIqoZceOCZur9eBocinKol162nmYjvKCF3G4TCWlh8Y3DZj39u4vwRoXSmLf9VsSfixvvQGRh F97GCT5pSdO0oBdU6eQmIx6bCUQk2mxyVUqSPLbvG48pktseurZHmcSI/A5FXuS4ClQ9t6eUk QJ1TVt7x+ujG/tupAfzCAWG3CZi3vkP5hstW+xDad60LebBjqfdx7Jjg8TCf19CUGa2CRHJQV WPzRT6Of770ZAFrGGZ7GgKngWFpwbmrq4TDhT/Jm759khErGDRWppTp2FW43KSzj77PxJROcE XhhcajTvHHmybhm6AIL8+2W5YL3h7j3sCcT53+oW0QHrpWGVnU1+H468zzpJ5bsdaK5g/XWmU 8mIV8h16o0U9lFb9knitrwOPWSkh9SjFQc5tprHbNdmXBbKMVlkcMOQP9D4kjBdkq4dMP3a/+ RiP8RfX3fPpmFPhj X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 23090 Cc: 23090@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 03/22/2016 07:35 PM, Ruediger Meier wrote: > echo 'int main(int argc, char **argv){return 0;}'> /tmp/true.c coreutils' src/true.c does exactly that - unless the user passes an argument: int main (int argc, char **argv) { /* Recognize --help or --version only if it's the only command-line argument. */ if (argc == 2) { ... } return EXIT_STATUS; } So what's your point here? File size? Well, on my openSUSE system /usr/bin/true needs 27328 bytes. Compared to the 6-7K your minimal example above result in (compiled with -O2 -g, then stripped), I'd consider this neglectable for nowadays' RAM and disk sizes. Re. '/usr/bin/[' --help: I'm using it myself from time to time, as I like the terse information there. Have a nice day, Berny From unknown Wed Jun 18 23:05:50 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 20 Apr 2016 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator