I currently have the following function:
function abs()
{
return ($1<0 ?-$1:$1);
}
When I try and run my script I am getting a syntax error:
bin/bash1.sh: line 5: syntax error near unexpected token `$1'
bin/bash1.sh: line 5: ` return ($1<0 ?-value:value);'
Could someone tell me how I should be writing this function?
Thank you.