Date: prev next · Thread: first prev next last
2010 Archives by date, by thread · List index


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


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.