[ClusterLabs] Need bash instead of /bin/sh

Jan Pokorný jpokorny at redhat.com
Wed Sep 23 20:30:05 UTC 2015


On 23/09/15 15:38 +0200, Ulrich Windl wrote:
>>>> Vladislav Bogdanov <bubble at hoster-ok.com> schrieb am 23.09.2015 um 15:24
>> 23.09.2015 15:42, dan wrote:
>>> Did a small test:
>>> ---------------test.sh----------------
>>> controld_start() {
>>>      local addr_list=$(echo AF_INET 10.1.1.1 AF_INET 10.1.1.2)
>> yep, that is a bashism.
>> 
>> posix shell denies assignment of local variables in the declaration.

This is supported by checkbashisms's finding (v2.15.5):

$ checkbashisms -p test.sh 
> script test.sh does not appear to have a #! interpreter line;
> you may get strange results
> possible bashism in test.sh line 2 (local foo=bar):
>     local addr_list=$(echo AF_INET 10.1.1.1 AF_INET 10.1.1.2)

> In times of BASH it's hard to get POSIX shell documentation.

Oh, really?

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html

It doesn't seem to recognize the concept of "local" declaration,
though.

> The last we had was from HP-UX. But the problem seems to be more $()
> than assignment it seems.

That documentation recognizes $() form.

-- 
Jan (Poki)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.clusterlabs.org/pipermail/users/attachments/20150923/54feab7e/attachment-0004.sig>


More information about the Users mailing list