×
Create a new article
Write your page title here:
We currently have 3,189 articles on s23. Type your article name above or create one of the articles listed here!



    s23
    3,189Articles
    (Redirected from SedStreamEditor)

    Beispiele[edit]

    Alle Zeichen "=F1" und "=F2" in einer Datei durch "X" ersetzten

    cat text.txt | sed -r s/"(=F1)|(=F2)"/X/g
    

    oder, um UUOC zu vermeiden:

    sed -r s/"(=F1)|(=F2)"/X/g text.txt
    


    HANDY ONE-LINERS FOR SED


    Inline replace for Solaris[edit]

    This is my 5 line backup and in-line replace for Solaris (will work on a lot of other *nix too) archive is a nice script use to backup files ;)

     # for x in $(grep -l kgl-fwall03-eth8 *) ; 
    	do archive $x ; mv $x $x.tmp ; 
    	sed s/kgl-fwall03-eth8/kgl-app-tier-fw-eth8/ $x.tmp > $x ; 
    	rm $x.tmp
      done
    

    You can change this to an inline delete by fidling the sed line e.g.

     sed "/_asigra /d" $x.tmp > $x ; 

    Man-Page[edit]

    <man>sed</man>

    see also: mansearch, man2html

    Cookies help us deliver our services. By using our services, you agree to our use of cookies.
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.