Help for this page

Select Code to Download


  1. or download this
    input:          desired output:     
      file1:          file1:            
    ...
        line1           line1           
        line2           line2           
        line3           line3
    
  2. or download this
    input:          desired output:     
      file1:          file1:            
    ...
        line2           line2           
        line3           line3
                        opt=bar
    
  3. or download this
    $ perl -i -pe '$f||=s/opt=.*/opt=bar/; END { print "opt=bar\n" if !$f 
    +}' file1 file2
    
  4. or download this
    #!/bin/bash
    
    ...
    
    echo --- cat after ---
    cat file1 file2
    
  5. or download this
    --- cat before ---
    line1
    ...
    line3
    line1
    line2
    
  6. or download this
    --- cat before ---
    line1
    ...
    line2
    line3
    opt=bar