Multiplication on command line terminal

后端 未结 8 1921
有刺的猬
有刺的猬 2020-12-04 08:00

I\'m using a serial terminal to provide input into our lab experiment. I found that using

$ echo \"5X5\"

just returns a string of \"

8条回答
  •  天涯浪人
    2020-12-04 08:09

    For more advanced and precise math consider using bc(1).

    echo "3 * 2.19" | bc -l 
    6.57
    

提交回复
热议问题