gpt4 book ai didi

linux - shell 脚本 : how to make a for loop among float number strings?

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:10:12 24 4
gpt4 key购买 nike

在 shell 脚本中,我想做一个 for 循环,比如

for(i=0.01;i<=4.0;i=i+0.01)

for i in seq(0.01,0.01,4.0)

但是$i是字符串,不是 float

我该怎么做?

谢谢!

最佳答案

for i in $(seq 0.01 0.01 4.0); do echo $i; done

关于linux - shell 脚本 : how to make a for loop among float number strings?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27971271/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com