bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bashisms


From: Ian Beckwith
Subject: bashisms
Date: Wed, 19 May 2010 02:54:52 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

Hi,

I got a bug report in debian about bashisms in gnulib
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=581105).
Working with a POSIX shell is a release goal for debian squeeze,
along with a switch to dash as /bin/sh.

I had a look with checkbashisms (from the devscripts package in debian
and ubuntu). I've attached the output.

Most instances are either wrapped in tests for their existence, false
positives or otherwise OK, but there are a few I'm not sure about:

* trap with signal numbers

According to http://www.opengroup.org/onlinepubs/009695399/utilities/trap.html
(btw, am I right in saying "The Open Group Base Specifications Issue 6
IEEE Std 1003.1, 2004 Edition" is POSIX, or at least a part of
it?), POSIX requires signals specified as names (HUP, INT, etc),
although XSI allows numbers for certain signals (the ones used by
gnulib all fall into this category).

* type

All uses of 'type' are along the lines of:

> possible bashism in gnulib-tool line 552 (type):
> if (type -p readlink) > /dev/null 2>&1; then

which won't cause a syntax error but could lead to fallback options
being chosen unnecessarily. Could these all be replaced by use of
which(1)?

* shopt

Most uses of shopt are fine, but there is one I'm not sure about:

> possible bashism in tests/init.sh line 112 (shopt):
> test -n "$EXEEXT" && shopt -s expand_aliases

Are there situations where $EXEEXT is set and bash is not running?

thanks,

Ian.

-- 
Ian Beckwith - address@hidden - http://erislabs.net/ianb/
GPG fingerprint: AF6C C0F1 1E74 424B BCD5  4814 40EC C154 A8BA C1EA

Attachment: bashisms
Description: Text document

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]