어려운 정규식 표현 몇개...

chxooi의 이미지

ansi 라는 들어가는 말을 검색했더니
transition
Transient
fLastTransit
등등 다 검색이 되네요

1.ansi 라는 딱 이단어만 검색하려면 어찌해야 할까요?

2.Text 파일안에 위의단어즉 transition 이들어있는 라인삭제, 또, fLastTransit가 들어있는 라인삭제...
이렇게 특정 단어가 포함된 라인을 지우려면 어떻게 해야할까요?

garam111의 이미지

1. grep "\<ansi\>" data.txt 
2. grep -v "\<transition\>\|\<fLastTransit\>" data.txt > new_data.txt

===================================
행동할 때 열정은 자라난다.

chxooi의 이미지

#grep "\ansi\" -rn * >aaaa.txt
>
#grep '\ansi\' -rn * >aaaa.txt
grep: 따라붙는 역슬래쉬

쩝 안되네요..흑..

imyejin의 이미지

egrep 를 쓰시거나 grep -e 옵션을 한번 줘보세요.

임예진 팬클럽 ♡예진아씨♡ http://cafe.daum.net/imyejin

[예진아씨 피카사 웹앨범] 임예진 팬클럽 ♡예진아씨♡ http://cafe.daum.net/imyejin

garam111의 이미지

grep "\<ansi\>" data.txt

grep 버전에 따라 다르게 나오나.. ㅜ.ㅜ
전 잘 나오는데요.. ㅜ.ㅜ

===================================
행동할 때 열정은 자라난다.

chxooi의 이미지

되네요...감사드립니다. :)