From 5181f2c6a59453cc19d0d3483d3be5e2b98ab25e Mon Sep 17 00:00:00 2001 From: Michael Mikonos <127171689+mknos@users.noreply.github.com> Date: Thu, 25 Jan 2024 21:14:26 +0800 Subject: [PATCH] echo: remove non-standard -? * Sometimes echo is built into the shell * Standards document for echo doesn't mention the -? flag [1] * Versions of echo that I tested don't support it * I think it's better to follow convention * Sync pod and fix a typo in DESCRIPTION 1. https://pubs.opengroup.org/onlinepubs/009604599/utilities/echo.html # bash builtin % builtin echo $BASH_VERSION 5.1.4(1)-release % builtin echo -? -? % builtin echo --version --version # gnu echo % /bin/echo -? -? % /bin/echo --version echo (GNU coreutils) 8.32 # pdksh builtin % builtin echo -? -? % builtin echo --version --version % builtin echo $KSH_VERSION @(#)PD KSH v5.2.14 99/07/13.2 # openbsd echo % /bin/echo -? -? % /bin/echo --version --version --- bin/echo | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/bin/echo b/bin/echo index f9294971..2e6ab00f 100755 --- a/bin/echo +++ b/bin/echo @@ -15,33 +15,15 @@ package PerlPowerTools::echo; use strict; -my ($VERSION) = '1.2'; +my ($VERSION) = '1.3'; __PACKAGE__->run( @ARGV ) unless caller(); sub run { my ( $self, @args ) = @_; - unless (@args) { - print "\n"; - exit 0; - } - - if ($args[0] eq '-?') { - print < accepts the following options: Do not print a newline after the arguments. -=item -? - -Print out a short help message, then exit. - =back =head1 ENVIRONMENT