I'm using a serial terminal to provide input into our lab experiment. I found that using
$ echo "5X5"
just returns a string of "5X5"
. Is there a command to execute a multiplication operation?
I'm using a serial terminal to provide input into our lab experiment. I found that using
$ echo "5X5"
just returns a string of "5X5"
. Is there a command to execute a multiplication operation?
A simple shell function (no sed needed) should do the trick of interpreting '5X5'
Internal Methods
Bash supports arithmetic expansion with
$(( expression ))
. For example:External Methods
A number of utilities provide arithmetic, including bc and expr.