Multiplication on command line terminal

后端 未结 8 1906
有刺的猬
有刺的猬 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:23

    The classical solution is:

     expr 5 \* 5
    

    Another nice option is:

     echo 5 5\*p | dc
    

    Both of these solutions will only work with integer operands.

提交回复
热议问题