Bug#381800: lintian: [checks/scripts] unjustified possible-bashism-in-maintainer-script
Package: lintian Version: 1.23.22 Severity: normal Currently, lintian reports the shell construct 'if [[ ... ]]' as bashism. I am not sure this is correct, since all POSIX 1003.2 resources available to me declare '[[' and ']]' a standard conditional expression check in POSIX sh (don't confuse with older Bourne sh). See, for example: http://www.informatik.uni-frankfurt.de/doc/man/hpux/sh-posix.1.html http://web.gat.com/docview/sh-posix.html Once this is fixed, as a side effect, lintian will allow compound conditional expressions, like 'if [[ ... ... || ... ]]', which are not allowed right now (lintian claims that '[['' is a bashism, it also bans 'if [ ... -a ...]' and 'if [ ... ... ]' is syntactically incorrect anyway). Thanks in advance, -- Sasha -- System Information: Debian Release: testing/unstable APT prefers testing APT policy: (500, 'testing') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.15-1-486 Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Versions of packages lintian depends on: ii binutils 2.17-2 The GNU assembler, linker and bina ii diffstat 1.43-1 produces graph of changes introduc ii dpkg-dev 1.13.21 package building tools for Debian ii file 4.17-2 Determines file type using magic ii gettext 0.14.6-1GNU Internationalization utilities ii intltool-debian 0.35.0+20060710 Help i18n of RFC822 compliant conf ii libparse-debianchangelog 1.0-1 parse Debian changelogs and output ii man-db 2.4.3-3 The on-line manual pager ii perl [libdigest-md5-perl 5.8.8-4 Larry Wall's Practical Extraction lintian recommends no packages. -- no debconf information -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#381800: lintian: [checks/scripts] unjustified possible-bashism-in-maintainer-script
Currently, lintian reports the shell construct 'if [[ ... ]]' as bashism. I am not sure this is correct, since all POSIX 1003.2 resources available to me declare '[[' and ']]' a standard conditional expression check in POSIX sh (don't confuse with older Bourne sh). See, for example: They are incorrect. http://www.opengroup.org/onlinepubs/95399/utilities/test.html -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#381800: lintian: [checks/scripts] unjustified possible-bashism-in-maintainer-script
Alexander L Belikoff [EMAIL PROTECTED] writes: Package: lintian Version: 1.23.22 Severity: normal Currently, lintian reports the shell construct 'if [[ ... ]]' as bashism. I am not sure this is correct, since all POSIX 1003.2 resources available to me declare '[[' and ']]' a standard conditional expression check in POSIX sh (don't confuse with older Bourne sh). Nope. [[ and ]] indicate built-in test evaluation, which is not a required feature of a POSIX shell. See: http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html and observe that [[ and ]] are mentioned only in the following text: The following words may be recognized as reserved words on some implementations (when none of the characters are quoted), causing unspecified results: [[ ]] function select So the behavior of [[ and ]] is unspecified in a pure POSIX shell. If you want to use [[ or ]], you need to use #!/bin/bash or some equivalent. -- Russ Allbery ([EMAIL PROTECTED]) http://www.eyrie.org/~eagle/ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]