击:评价一个数学术语? [英] Bash: evaluate a mathematical term?
本文介绍了击:评价一个数学术语?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
echo 3+3
我怎么能到6评估等猛砸前pressions,在这种情况下?
How can I evaluate such expressions in Bash, in this case to 6?
推荐答案
,你可以使用花车的数学。如果你需要更多的数学能力,利用工具,如 BC / AWK / DC
in shells such as zsh/ksh, you can use floats for maths. If you need more maths power, use tools like bc/awk/dc
例如
var=$(echo "scale=2;3.4+43.1" | bc)
var=$(awk 'BEGIN{print 3.4*43.1}')
看着你正在尝试做的。
looking at what you are trying to do
awk '{printf "%.2f\n",$0/59.5}' ball_dropping_times >bull_velocities
这篇关于击:评价一个数学术语?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文