相关疑难解决方法(0)

如何比较Bash中点分隔版本格式的两个字符串?

有没有办法比较的庆典,如这样的字符串:2.4.52.82.4.5.1

linux versioning bash

157
推荐指数
15
解决办法
7万
查看次数

在bash shell脚本中如何将字符串转换为数字

嘿我想将字符串转换为数字

x="0.80"

#I would like to convert x to 0.80 to compare like such:
if[ $x -gt 0.70 ]; then

echo $x >> you_made_it.txt 

fi 
Run Code Online (Sandbox Code Playgroud)

现在我得到错误整数表达式,因为我试图比较一个字符串.

谢谢

bash shell

12
推荐指数
2
解决办法
7万
查看次数

标签 统计

bash ×2

linux ×1

shell ×1

versioning ×1