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