running sh scripts through shellcheck

Rowland Penny rpenny at
Fri Aug 11 09:45:58 UTC 2017

On Fri, 11 Aug 2017 09:20:33 +0100
Rowland Penny via samba-technical <samba-technical at>

> OK, I have got to ctdb/tests/complex/ where I
> have found this:
> echo "Getting MAC address associated with ${test_ip}..."
> releasing_mac=$(ip neigh show "$test_prefix" | awk '$4 ==
> "lladdr" {print $5}') [ -n "$releasing_mac" ] || die "Couldn't get
> MAC address for ${test_prefix}" echo "MAC address is:
> ${releasing_mac}"
> So, who doesn't know that 'die' is a perl thing ?
> There doesn't seem to be a 'die' function.
> The script is also a 'bash' script instead of a 'sh' script.
> Rowland

Forget it, found 'die' in ctdb/tests/scripts/, still think
calling it 'die' was a bad idea though

It still shouldn't be a 'bash' script, it isn't portable, which brings
me to ctdb/tests/complex/

Changing #!/bin/bash to #!/bin/sh causes this:

In ctdb/tests/complex/ line 69:
if [ "${out/SRC: ${src_socket} /}" != "$out" ] ; then
      ^-- SC2039: #!/bin/sh was specified, but string replacement is not standard.

I will have to find the relevant code, decipher it and re-write it for


More information about the samba-technical mailing list