일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- 온도조절기
- 가스요금폭탄
- 나비엔
- 가스비절약
- 네모안
- react-native
- Node
- ReactNative
- 린나이온도조절기
- Raspberry Pi
- anydo
- __attribute__
- Swipes
- EditText
- nodejs
- evernote
- 경동
- rasppi3
- debounce
- node.js
- 난방비절약
- 라온익스
- todoist
- 온도센서
- 기름보일러
- npm moment
- 에버노트
- REACT
- xcode11
- IOT
- Today
- Total
어허
sed 명령어 사용법 본문
doc 문서로 정리했던 내용
>> sed 명령어 사용법
[injeuniv@laon2 hello]$ cat in.file hello say ho goodbye [injeuniv@laon2 hello]$ echo "1234hello5678" | sed "s/hello/goodbye/" 1234goodbye5678 # hello를 goodbye로 바꾸어 표준 출력에 출력한다. [injeuniv@laon2 hello2]$ sed "/hello/d" in.file say ho goodbye
[injeuniv@laon2 hello2]$ grep -v hello in.file say ho goodbye
[injeuniv@laon2 hello2]$ sed "s/hello//" in.file
say ho goodbye
[injeuniv@laon2 hello2]$ sed "/hello/,/goodbye/s/say/putyourhandsup/g" in.file hello putyourhandsup ho goodbye # hello 부터 goodbye 라인 까지 say 를 찾아서 putyourhandsup으로 치환 |
[injeuniv@laon2 hello2]$ sed "s/hello/goodbye" in.file
sed: -e expression #1, char 15: unterminated `s' command
이 오류가 해결이 안된다. 구분자를 /(슬래쉬) 말고 | 나 다른걸로 해보라고 해서 해봤는데도 안됨
어쨌든 sed는 stream editor로 파일내용을 수정해 표준 출력에 출력해주고 파일내용을 수정할 수도 있다.
http://wiki.kldp.org/Translations/html/Sed-KLDP/index.html
'개발 > Linux' 카테고리의 다른 글
[SVN] remains in conflict 에러 해결 (0) | 2013.01.18 |
---|---|
리눅스 putty등 터미널창에 현재 경로 표시하기 (0) | 2011.12.22 |
[vi] Makefile 등 tab이 잘 들어가있나 확인하자 (0) | 2011.11.10 |
[vi] ^M 지울때 기억할 것 (0) | 2011.11.10 |
busybox 1.18.4 컴파일 ! (0) | 2011.03.22 |