0

For an assignment I am working on I need to covert miles to kilometers inside of a shell script.

I need to multiple the amount read in by 1.609 to convert it, but Bash doesn’t like decimals.

So I tried to multiple it by 1609 and then divide by 1000.

That didn’t work either. Do you have any suggestions on how I can multiply by a decimal?

markio
  • 11
  • 2
  • @jmarlynshi : There is an external program called `bc` which you can use for this purpose. Otherwise: Do you **have** to do it in bash, or can you also do it in a shell which understands floating point arithmetic, i.e. _zsh_? – user1934428 Sep 13 '21 at 06:53

0 Answers0