From 32196caf8dee7d4494c94b5eddceaf9b974bd3b9 Mon Sep 17 00:00:00 2001 From: Michael Mikonos <127171689+mknos@users.noreply.github.com> Date: Thu, 1 Aug 2024 19:05:23 +0800 Subject: [PATCH 1/2] true: ignore options * Standards document says that true does not handle options [1] * No reference to options in the solaris manual either [2] * I tested 4 versions of true and only the GNU version handles options * test1: /bin/true --version # gnu version on linux * test2: builtin true --version # bash builtin on linux * test3: /usr/bin/true --version # openbsd version * test4: builtin true --version # ksh builtin on openbsd 1. https://pubs.opengroup.org/onlinepubs/009695399/utilities/true.html 2. https://shrubbery.net/solaris9ab/SUNWaman/hman1/true.1.html --- bin/true | 58 ++++++-------------------------------------------------- 1 file changed, 6 insertions(+), 52 deletions(-) diff --git a/bin/true b/bin/true index 4e1c841f..f9cdfd07 100755 --- a/bin/true +++ b/bin/true @@ -11,36 +11,7 @@ License: perl =cut - -use strict; - -my ($VERSION) = '1.3'; - -my $STATUS = 0; - -if (@ARGV) { - if ($ARGV [0] eq '--version') { - $0 =~ s{.*/}{}; - print "$0 (Perl bin utils) $VERSION\n"; - exit; - } - if ($ARGV [0] eq '--help') { - $0 =~ s{.*/}{}; - my $success = $STATUS ? "failure" : "success"; - print < exits succesfully. I exits unsuccesfully. - -=head2 OPTIONS - -I and I accept the following options: - -=over 4 - -=item --help - -Print out a short help message, then exit. - -=item --version - -Print out its version number, then exit. - -=back +I exits succesfully. =head1 ENVIRONMENT -The working of I and I are not influenced by any -environment variables. +The working of I is not influenced by any environment variables. =head1 BUGS -I and I have no known bugs. +I has no known bugs. =head1 AUTHOR -The Perl implementation of I and I +The Perl implementation of I was written by Abigail, I. =head1 COPYRIGHT and LICENSE From 5589ebec9dd3ec18c9fda6e50d3b84962324e2ac Mon Sep 17 00:00:00 2001 From: Michael Mikonos <127171689+mknos@users.noreply.github.com> Date: Thu, 1 Aug 2024 19:07:47 +0800 Subject: [PATCH 2/2] false: ignore options * Following GNU behaviour is not required or desirable when it comes to option handling --- bin/false | 58 ++++++------------------------------------------------- 1 file changed, 6 insertions(+), 52 deletions(-) diff --git a/bin/false b/bin/false index 42159ff8..ad638eed 100755 --- a/bin/false +++ b/bin/false @@ -11,36 +11,7 @@ License: perl =cut - -use strict; - -my ($VERSION) = '1.3'; - -my $STATUS = 1; - -if (@ARGV) { - if ($ARGV [0] eq '--version') { - $0 =~ s{.*/}{}; - print "$0 (Perl bin utils) $VERSION\n"; - exit; - } - if ($ARGV [0] eq '--help') { - $0 =~ s{.*/}{}; - my $success = $STATUS ? "failure" : "success"; - print < exits succesfully. I exits unsuccesfully. - -=head2 OPTIONS - -I and I accept the following options: - -=over 4 - -=item --help - -Print out a short help message, then exit. - -=item --version - -Print out its version number, then exit. - -=back +I exits unsuccesfully. =head1 ENVIRONMENT -The working of I and I are not influenced by any -environment variables. +The working of I is not influenced by any environment variables. =head1 BUGS -I and I have no known bugs. +I has no known bugs. =head1 AUTHOR -The Perl implementation of I and I +The Perl implementation of I was written by Abigail, I. =head1 COPYRIGHT and LICENSE