문제

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?

Thanks.

도움이 되었습니까?

해결책

This should do it

tr -c '[:cntrl:][:print:]' '\n'

Depending on locale you might need to

LANG= tr -c '[:cntrl:][:print:]' '\n'

Or this

tr -c $'\x01-\x7e' '\n'
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top