Incorrect shell syntax

Shell haven't `function` keyword or double brackets. This generates errors on Ubuntu 12.04 and 14.10.