Cygwin和tr设置 [英] Cygwin and tr settings
本文介绍了Cygwin和tr设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用Unix实用程序tr通过Cygwin。我要替换\ n的非字母字符,但是tr也将重音字符识别为非字母字符(ěščřžýáíé - > \ n)。我可以更改此设置吗?
I use a Unix utility tr via Cygwin. I want to replace the non-alphabetical characters for '\ n', but tr also recognize accented characters as non-alphabetic (ěščřžýáíé -> \ n). Can I change this setting?
感谢。
推荐答案
do it
tr -c '[:cntrl:][:print:]' '\n'
根据区域设置,您可能需要
Depending on locale you might need to
LANG= tr -c '[:cntrl:][:print:]' '\n'
或此
tr -c $'\x01-\x7e' '\n'
这篇关于Cygwin和tr设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文