Questions tagged «mathematical-expressions»

11
如何在Bash脚本中添加数字?
我有这个Bash脚本,在第16行遇到问题。如何获取第15行的先前结果并将其添加到第16行的变量中? #!/bin/bash num=0 metab=0 for ((i=1; i<=2; i++)); do for j in `ls output-$i-*`; do echo "$j" metab=$(cat $j|grep EndBuffer|awk '{sum+=$2} END { print sum/120}') (line15) num= $num + $metab (line16) done echo "$num" done
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.