checkbashisms test <printf %q|%b> doesn't find those bashisms from the beginning of a string
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
devscripts (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Steps to produce:
1. create a script test.sh containing the following:
#!/bin/sh
printf "test %b\n" "test"
printf "%b test\n" "test"
2. run "checkbashisms test.sh"
possible bashism in test.sh line 2 (printf %q|%b):
printf "test %b\n" "test"
3. It didn't find the bashism on line 3.
Luckily checkbashisms script can be fixed quite easily. Here's the diff:
--- /usr/bin/
+++ scripts/
@@ -688,7 +688,7 @@
qr'\$
qr'\$
qr'\$
- $LEADIN . qr'printf\
+ $LEADIN . qr'printf\
);
%singlequo
After the change it works as expected:
$ scripts/
possible bashism in test.sh line 2 (printf %q|%b):
printf "test %b\n" "test"
possible bashism in test.sh line 3 (printf %q|%b):
printf "%b test\n" "test
ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: devscripts 2.14.1ubuntu0.1
ProcVersionSign
Uname: Linux 3.13.0-57-generic x86_64
NonfreeKernelMo
ApportVersion: 2.14.1-0ubuntu3.11
Architecture: amd64
CurrentDesktop: Unity
Date: Thu Jul 23 17:41:50 2015
InstallationDate: Installed on 2014-05-16 (433 days ago)
InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Release amd64 (20140417)
SourcePackage: devscripts
UpgradeStatus: No upgrade log present (probably fresh install)
Reported to Debian: https:/ /bugs.debian. org/cgi- bin/bugreport. cgi?bug= 793396