1
내가 사용하고 :sed를 사용하여 문자 범위 정규 표현식의 문자를 유지 하시겠습니까?
cat this_file | sed ':a;N;$!ba;s/\n[a-z]/ [a-z]/g' > that_file
샘플 텍스트 :
However the text \n
looks like this when it replaces the newline.\n
출력 :이 무엇을
However the text [a-z]ooks like this when it replaces the newline.\n
라고? 내가 뭘 잘못하고 있는지에 대한 제안은?
우수 :
또한, 당신이 고양이의 불필요한 사용을 피할 수 : 당신은 역 참조를 사용해야합니다. 덕분에 나는 역 참조를 알지 못했습니다. 매력처럼 일했습니다. – jmunsch