I have a feeling this script was created on OSX because then it would be
being executed using on old bash in strict mode. On Ubuntu 14.04 though
it's executed using dash and various parts fall over because there's a
bunch of bash-specific code in here.
I corrected the problems that the checkbashisms script reported and it
seems to be working better now.
- Use printf instead of echo where escapes are necessary.
- Don't use double bracketed if statements where unnecessary.
- Use -o instead of ||