Bug#772343: checkbashisms: mis-detection of >&@
Thorsten Glaser
tg at mirbsd.de
Sat Dec 6 14:14:58 UTC 2014
Package: devscripts
Version: 2.14.11
Severity: minor
Hi,
the following script causes a checkbashism mis-detection:
-----BEGIN cutting here may damage your screen surface-----
#!/bin/sh
echo >&@ E: $2 returned error code $1
echo >&2 bla
-----END cutting here may damage your screen surface-----
tglase at tglase:~ $ checkbashisms x
possible bashism in x line 2 (should be >word 2>&1):
echo >&@ E: $2 returned error code $1
This was first reported in #772290 (thanks Raphael Geissert).
The >&@ is a genuine typo for >&2 and not a bashism¹. That being
said, it would be nice if checkbashisms could continue reporting
it, because of the following:
tglase at tglase:~ $ mksh x foo bar
x[2]: >&@ : illegal file descriptor name
bla
tglase at tglase:~ $ bash x foo bar
bla
tglase at tglase:~ $ dash x foo bar
x: 3: x: Syntax error: Bad fd number
dash aborts the script, instead of continuing, as the other shells
do, which is usually the wrong thing to do.
① … and especially not the dreaded &> bashism.
-- Package-specific info:
--- /etc/devscripts.conf ---
--- ~/.devscripts ---
DEBCHANGE_AUTO_NMU=no
DEBCHANGE_MAINTTRAILER=no
DEBCHANGE_MULTIMAINT_MERGE=yes
DEBCHANGE_RELEASE_HEURISTIC=log
-- System Information:
Debian Release: 8.0
APT prefers unreleased
APT policy: (500, 'unreleased'), (500, 'buildd-unstable'), (500, 'unstable')
Architecture: x32 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/lksh
Init: sysvinit (via /sbin/init)
Versions of packages devscripts depends on:
ii dpkg-dev 1.17.22
ii libc6 2.19-13
ii perl 5.20.1-3
ii python3 3.4.2-2
pn python3:any <none>
Versions of packages devscripts recommends:
ii at 3.1.16-1
ii curl 7.38.0-3
ii dctrl-tools 2.23
ii debian-keyring 2014.08.31
ii dput 0.9.6.4
pn equivs <none>
ii fakeroot 1.20.2-1
ii file 1:5.20-2
ii gnupg 1.4.18-6
pn libdistro-info-perl <none>
ii libencode-locale-perl 1.03-1
ii libjson-perl 2.61-1
ii liblwp-protocol-https-perl 6.06-2
pn libparse-debcontrol-perl <none>
pn libsoap-lite-perl <none>
ii liburi-perl 1.64-1
ii libwww-perl 6.08-1
ii lintian 2.5.30+deb8u3
ii man-db 2.7.0.2-3
ii patch 2.7.1-6
ii patchutils 0.3.3-1
pn python3-debian <none>
pn python3-magic <none>
ii sensible-utils 0.0.9
ii strace 4.9-2
ii unzip 6.0-12
ii wdiff 1.2.2-1
ii wget 1.16-3
ii xz-utils 5.1.1alpha+20120614-2+b1
Versions of packages devscripts suggests:
ii bsd-mailx [mailx] 8.1.2-0.20140825cvs-1
ii build-essential 11.7
pn cvs-buildpackage <none>
pn debbindiff <none>
pn devscripts-el <none>
pn gnuplot <none>
ii gpgv 1.4.18-6
pn libauthen-sasl-perl <none>
pn libfile-desktopentry-perl <none>
ii libnet-smtp-ssl-perl 1.01-3
pn libterm-size-perl <none>
ii libtimedate-perl 2.3000-2
pn libyaml-syck-perl <none>
pn mutt <none>
ii openssh-client [ssh-client] 1:6.7p1-3
pn svn-buildpackage <none>
pn w3m <none>
-- Configuration Files:
/etc/bash_completion.d/devscripts.pkgnames [Errno 2] No such file or directory: u'/etc/bash_completion.d/devscripts.pkgnames'
-- no debconf information
More information about the devscripts-devel
mailing list