[Libreoffice] small utility script to handle ../bin/g and similar commands
Tor Lillqvist
tlillqvist at novell.com
Sat Oct 9 08:32:24 PDT 2010
> Personal, but valid. To test that you actually don't introduce bashisms
> in a script you can simply set env variable POSIXLY_CORRECT=1 and then
> the bash when invoked as /bin/sh will behave as a strict posix shell.
Unfortunately that doesn't work well enough- Even with POSIXLY_CORRECT=1 some bashisms work without any warning message. Yeah, so one kinda is left wondering what the point with POSIXLY_CORRECT is then.
I found this useful script: http://ftp.openbsd.org/ports/sysutils/checkbashisms/files/checkbashisms.pl . No doubt there might be other similar ones.
Another way is to actually develop a script using a #! line referring to some suitably limited shell on your platform, and then change that to /bin/sh before submitting as a patch or committing to git.
--tml
More information about the LibreOffice
mailing list