Older bash versions (< 3.2) fail with: "Syntax error in conditional expression: unexpected token `('"
When trying to ssh to a host, I got the following error:
/usr/share/monkeysphere/common: line 447: syntax error in conditional expression: unexpected token `(' ssh_exchange_identification: Connection closed by remote host
Code in question is:
[[ "$1" =~ ^[a-z0-9]([a-z0-9-]*[a-z0-9])?$ ]] || \
To fix use instead something like this:
[[ "$1" =~ "^[a-z0-9]([a-z0-9-]*[a-z0-9])?$" ]] || \
This fix is also provided at commit "fba2e86cc1c0926f69b13ee6e4e2674178529ab5":http://git.sarava.org/?p=monkeysphere.git;a=commit;h=fba2e86cc1c0926f69b13ee6e4e2674178529ab5 in my branch.
(from redmine: created on 2010-02-18, closed on 2010-03-14)