例如:
#!/bin/bash
printf '%s' "write 4 numbers separated by spaces:"
read -r var
# suppose to print sum of calculated numbers, in this case I want to calculate like this:
# ((1n*2n)+(3n*4n))/2 <----divided by (total item/2)
exit 0
所以,假设我们在执行代码时输入了 4 个数字,让我们输入 ,11 22 33 44.4然后,如果我没记错的话enter,我们得到了结果。853.6