내가 좋아하는 라인이 포함 된 텍스트 파일이 있습니다백 스페이스 및 단어로 단어를 어떻게 배치합니까?
telephone xxxx
telpassword xxxx
telephone xxxx
telpassword xxxx
telephone xxxx
telpassword xxxx
telephone xxxx
telpassword xxxx
telephone xxxx
telpassword xxxx
telephone xxxx
telpassword xxxx
와 나는 같은 데이터를 포함하는 파일을 만들고 싶어하지만 라인 :
telephone xxxx telpasswordxxxx
telephone xxxx telpasswordxxxx
telephone xxxx telpasswordxxxx
telephone xxxx telpasswordxxxx
telephone xxxx telpasswordxxxx
나는 시도 :
sed 's/telpassword/\btelpassword/g'
그러나이 명령은 작동하지 않습니다. 나는 이런 식으로해야한다고 생각하지만, "backspace"명령을 어떻게 두는 지 알 수 없다.
도움 주셔서 감사합니다. sed one liners에서
안녕하세요, sed 명령이 작동하지만, 내 파일에 비어있는 몇 줄이 있다고 생각합니다. sed 명령을 "telpassword"또는 "telephone"문자열로 조정할 수 있습니까? –
명령 앞에'grep tel |'를 추가하십시오. '| '를 추가하는 것을 잊지 마십시오. – devnull