简体   繁体   English

关于Linux shell tr​​命令的错误

[英]Error about the tr command of linux shell

When I type this command : 当我输入以下命令时:

$ echo 1234567890 | tr '9-0' '9876'

It says "tr: range-endpoints of '9-0' are in reverse collating sequence order". 它说:“ tr:'9-0'的范围端点按反向整理顺序排列”。 What does this mean? 这是什么意思? Does it means I can only type like "0-9"? 这是否意味着我只能输入“ 0-9”?

Yes, that's exactly what it means. 是的,这就是它的意思。 '9-0' isn't a range, anymore than 'za' is a range. “ 9-0”不是范围,而“ za”是范围。 Otherwise, how does it know whether you mean 0-9 or the entire unicode range starting from 9, going to the top of the range and wrapping around back to 0? 否则,它如何知道您是指0-9还是整个unicode范围(从9开始),到达该范围的顶部并回绕到0?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM