Why need double braces to evaluate a math operation?
like
Code:
echo $(($1*$2)) Code:
echo $($1*$2) |
Because the $(...) syntax is for command substitution and bash cannot distinguish them otherwise.
|
$((op)) tells it to do a math operation
$(op) tells it to execute that command as if it was typed on the command line, ie: $(date +%s) |
Quote:
|
Try checking out man bash
|
All times are GMT -5. The time now is 04:39 AM. |