Bug#870309: [checkbashisms] False positive in "sourced script with arguments"

Ben Finney bignose at debian.org
Tue Aug 1 02:07:46 UTC 2017


Chris Lamb <lamby at debian.org> writes:

> Note that the unquoted version on line 3 is not warned about. Not sure
> if this is due to the subshell or the implicit nested quotes..

To distinguish, I've made another test case. Attached to this message
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 870309.test.sh
Type: text/x-sh
Size: 379 bytes
Desc: Test script as input for checkbashisms
URL: <http://lists.alioth.debian.org/pipermail/devscripts-devel/attachments/20170801/0180987b/attachment.sh>
-------------- next part --------------

That causes two warnings from ?checkbashisms?:

=====
$ checkbashisms ./870309.test.sh
possible bashism in ./870309.test.sh line 10 (sourced script with arguments):
. "$(printf "lorem %s\n" foo bar baz)"
possible bashism in ./870309.test.sh line 13 (sourced script with arguments):
. "$(printf "lorem %s\n" "foo bar baz")"
=====

So, it complains when the argument to ?.? is a quoted command
substitution, but not when it's an unquoted command substitution.

-- 
 \      ?I busted a mirror and got seven years bad luck, but my lawyer |
  `\                        thinks he can get me five.? ?Steven Wright |
_o__)                                                                  |
Ben Finney <bignose at debian.org>


More information about the devscripts-devel mailing list