When I run the following command:
expr 1.2 * 13
I get this error:
expr: syntax error: unexpected argument '12'
I expect I am missing a syntax. What is it?
When I run the following command:
expr 1.2 * 13
I get this error:
expr: syntax error: unexpected argument '12'
I expect I am missing a syntax. What is it?
Copyright © 2021 Jogjafile Inc.
The asterisk is expanded as a glob, so you'll end-up running something like
expr 1.2 file1 file2 13
Also,
the shell cannot do arithmetic with floating point numbersfloating point arithmetic with the shell isn’t standard:You'll need to use a command like
bc
/awk
/etc... or convert your numbers to integers: