我想按命令行根据字符代码或ASCII代码值对文本行进行排序.我尝试了以下命令行,但结果不是我的预期.
# string=" 8888888
>'
> Transportation
> Temp
>temp
>TEMP
> 99
> Temp
> Temporary"
# LC_ALL=C echo "$string" | sort
'
8888888
99
temp
Temp
Temp
TEMP
Temporary
Transportation
Run Code Online (Sandbox Code Playgroud)
要根据ASCII代码值进行排序,输出应该如下
99
Temp
8888888
Temporary
Temp
Transportation
'
TEMP
temp
Run Code Online (Sandbox Code Playgroud)
有谁知道这是怎么做到的吗?