Dixi quod...

>Commit ID:     1004B7D8F0055A68A5A

>Log message:
>unbreak after cid 1004B61A9B525E85DF5 - OpenBSD ports use a
>non-POSIX construct here

While this is a Makefile, not a shell script, I wonder if
someone(tm) could leverage something like the checkbashisms
script to scan for these things. It would have two modes,
one for POSIX stuff (like this one outlined below) and one
for non-POSIX stuff (like bash or Korn extensions, like the
getopts builtin change in mksh R39b).

This one was:

#!/bin/sh
if ! set -- $(false); then
        echo you fail
fi
set -- $(false)
echo this is 0: $?

bash, dash, pdksh, posh, zsh behave; mksh R39 (not R39b) doesn't,
and OpenBSD seems to actively write code exploiting this malfunction;
the getopt(1) manpage also used to recommend it.

bye,
//mirabilos
-- 
Sometimes they [people] care too much: pretty printers [and syntax highligh-
ting, d.A.] mechanically produce pretty output that accentuates irrelevant
detail in the program, which is as sensible as putting all the prepositions
in English text in bold font.   -- Rob Pike in "Notes on Programming in C"


-- 
To unsubscribe, send mail to [email protected].

Reply via email to