Bash - return a boolean check
<p>I created a simple function which does a regex check:</p>

<pre><code>function is_number()
{
    return [[ "$1" =~ ^-?[0-9]+$ ]]
}
</code></pre>

<p>What I get is </p>

<pre><code>return: [[: numeric argument required
</code></pre>

<p>What am I doing wrong?</p>