sed 프로필
grep 와 마찬가지 로 sed 는 한 줄 한 줄 로 처 리 됩 니 다.sed 텍스트 를 처리 할 때 먼저 원본 파일 을 메모리 에 복사 한 다음 에 텍스트 한 줄 한 줄 을 패턴 공간 에 가 져 와 조작 하고 마지막 으로 표준 출력, 즉 화면 에 출력 합 니 다.
패턴 공간 에서 모든 줄 은 사용자 가 준 조건 에 따라 일치 합 니 다. 편집 후 출력 할 때 일치 하지 않 고 표준 출력 으로 직접 출력 합 니 다.sed 는 모델 공간 을 제외 하고 공간 을 유지 하여 모델 공간 과 공간 을 여러 번 처리 하고 복잡 한 처리 작업 을 완성 할 수 있 습 니 다.
sed [option]...'script' [input-file]...
    script:
            、    
        :
        -n, --quiet, --slient:              ,     
            suppress automatic printing of pattern space:             
        -e script, --expression=script:        ,        ,    
            add the script to the commands to be executed.
        -f script, --expression=script:
            add the contents of script-file to the commands to be executed
        -r. --regxp-extended:           
        -i[SUFFIX], --in-place[=SUFFIX]:       
        :
        1.   :    
        2.   :
            # : # 
            /patter/ :           
        3.    :
            #,# :
            #,+# :  #     # 
            #,/pat1/ :  #   ,           
            /pat1/,/pat2/ : /pat1/ /pat2/
        4.  :~
            1~2:     
        (COMMANDS):
       d  ,   -n  
        d :        ;
        p :print the current pattern space
                        
        a \text:
            append text, which has each embedded newline preceded by a backslash
                ,                   。   
      
        i \text:
            insert text,which has each embedded newline preceded by a backslash
                ,                  。   
      
        c \text:
            replace the selected lines with text,which has each embedded newline preceded by a backlash.
                     ,~。~
        w /path/to/somefile:
            write the current pattern space to filename
                              ;
        r /path/to/somefile:
            append text read from filename
                
        = :            
        ! :    , COMMAND  ;
                !    
        s/// :    ,         ,   s@@@,s### 
                :
                g :    
                W /path/to/somefile:                ;
                P :        
  hold space (공간 유지) 에 고급 명령 이 있 습 니 다.
      :
    h H    copy/append pattern space to hold space.
    g G    Copy/append hold space to pattern space.
    x      Exchange the contents of the hold and pattern spaces.
    n N    Read/append the next line of input into the pattern space.
    d      Delete pattern space.  Start next cycle.
    D      If  pattern  space contains no newline, start a normal new cycle as if the d command was issued.  Otherwise, delete text in the pattern space up  to  the first  newline,  and restart cycle with the resultant pattern space, without reading a new line of input.
                이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
다양한 언어의 JSONJSON은 Javascript 표기법을 사용하여 데이터 구조를 레이아웃하는 데이터 형식입니다. 그러나 Javascript가 코드에서 이러한 구조를 나타낼 수 있는 유일한 언어는 아닙니다. 저는 일반적으로 '객체'{}...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.