unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#19658: unportable test(1) comparison operator
@ 2015-01-22 23:10 Thomas Klausner
  2015-01-25  3:03 ` Paul Eggert
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Klausner @ 2015-01-22 23:10 UTC (permalink / raw)
  To: 19658

[-- Attachment #1: Type: text/plain, Size: 339 bytes --]

Hi!

In emacs git as of yesterday, test/indent/shell.sh contains the
unportable '==' comparison operator for test(1) -- only bash supports
that, not even GNU coreutils' test(1).

Please use '=' instead; see attached patch.

Thanks,
 Thomas

P.S.: I know it's not intended to be executed, but I'd like to avoid
having bad examples around :)

[-- Attachment #2: patch-af --]
[-- Type: text/plain, Size: 264 bytes --]

--- test/indent/shell.sh.orig	2011-02-16 02:00:00.000000000 +0000
+++ test/indent/shell.sh
@@ -70,7 +70,7 @@ help2
 EOF2
 }
 bar () {
-    if [ $# == 0 ]; then
+    if [ $# = 0 ]; then
         while
             f                   # KNOWN INDENT BUG
         do

^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#19658: unportable test(1) comparison operator
  2015-01-22 23:10 bug#19658: unportable test(1) comparison operator Thomas Klausner
@ 2015-01-25  3:03 ` Paul Eggert
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggert @ 2015-01-25  3:03 UTC (permalink / raw)
  To: 19658-done

Thanks I changed it to '[ $# -eq 0 ]', which is more portable yet, as it works 
even if a purposely-pedantic shell sets $# to '00'.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-25  3:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-22 23:10 bug#19658: unportable test(1) comparison operator Thomas Klausner
2015-01-25  3:03 ` Paul Eggert

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).