Bash:用指数排序数字

我正在尝试使用如下数值排序一个文件:
414e-05
435e-05
0.5361
0.7278
0.1341
0.9592
0.2664

排序所有的数组得到排序,除了具有指数的数组,排序函数有一些方法来评估这个表达式吗?

如果你的sort命令的版本是足够新的,如果你喜欢你的选项,它应该支持-g选项(或–general-numeric-sort).在信息手册中描述如下:

Sort numerically,using the standard C function strtod to convert a prefix of each line to a double-precision floating point number. This allows floating point numbers to be specified in scientific notation,like ‘1.0e-34′ and ’10e100’.

相关文章

用的openwrt路由器,家里宽带申请了动态公网ip,为了方便把2...
#!/bin/bashcommand1&command2&wait从Shell脚本并行...
1.先查出MAMP下面集成的PHP版本cd/Applications/MAMP/bin/ph...
1、先输入locale-a,查看一下现在已安装的语言2、若不存在如...
BashPerlTclsyntaxdiff1.进制数表示Languagebinaryoctalhexa...
正常安装了k8s后,使用kubect工具后接的命令不能直接tab补全...