본문 바로가기
카테고리 없음

sed 명령어 옵션 (파파고 번역)

by Sondho 2020. 11. 19.

-E

정규식을 기본 정규식(BRE)이 아닌 확장(현대식) 정규식으로 해석한다.  re_format(7) 설명서 페이지에는 두 가지 형식이 모두 설명되어 있다.

-a

"w" 함수에 대한 매개 변수로 나열된 파일은 기본적으로 처리가 시작되기 전에 생성되거나 잘린다.  -a 옵션은 관련 ``w" 함수를 포함하는 명령이 입력 라인에 적용될 때까지 각 파일 열기를 지연시키는 원인이 된다.

-e 명령어
명령 인수에 의해 지정된 편집 명령을 명령 목록에 추가하십시오.

-f command_file
command_file 파일에 있는 편집 명령을 명령 목록에 추가하십시오.  편집 명령은 각각 별도의 줄에 나열되어야 한다.

-i 확장
파일을 제자리에 편집하여 지정된 확장자로 백업을 저장하십시오.  제로 길이 확장이 주어지면 백업은 저장되지 않는다.  디스크 공간이 모두 소진된 상황에서 파일이 손상되거나 부분적인 내용이 발생할 위험이 있으므로, 파일 내부 편집 시에는 제로 길이 확장을 하지 않는 것이 좋다.

-l

출력 라인을 버퍼링하도록 한다.

-n

기본적으로 모든 명령이 적용된 후 각 입력 라인이 표준 출력에 반영된다.  -n 옵션은 이 동작을 억제한다.


-E      Interpret regular expressions as extended (modern) regular expressions rather than basic regular
             expressions (BRE's).  The re_format(7) manual page fully describes both formats.

     -a      The files listed as parameters for the ``w'' functions are created (or truncated) before any pro-
             cessing begins, by default.  The -a option causes sed to delay opening each file until a command
             containing the related ``w'' function is applied to a line of input.

     -e command
             Append the editing commands specified by the command argument to the list of commands.

     -f command_file
             Append the editing commands found in the file command_file to the list of commands.  The editing
             commands should each be listed on a separate line.

     -i extension
             Edit files in-place, saving backups with the specified extension.  If a zero-length extension is
             given, no backup will be saved.  It is not recommended to give a zero-length extension when in-place
             editing files, as you risk corruption or partial content in situations where disk space is
             exhausted, etc.

     -l      Make output line buffered.

     -n      By default, each line of input is echoed to the standard output after all of the commands have been
             applied to it.  The -n option suppresses this behavior.

댓글