jake RSS


jakehofman.com

Archive

Mar
12th
Thu
permalink

tip: sed

to keep part of a pattern for substitution, use parens+backslash, e.g. s/123\([xyz]\)/\1/ http://tinyurl.com/aaw7q

tips  sed 
Jul
28th
Mon
permalink

tip: sed

to print text between two patterns, inclusive, use sed -n /pattern1/,/pattern2/p

tips  sed 
Mar
22nd
Thu
permalink

tip: sed

to print from a pattern to the end of a file, sed -n /pattern/,$p

tips  sed 
Mar
16th
Thu
permalink

tip: sed

to reverse the lines of a file (last line first), use: sed ‘1!G;h;$!d’

tips  sed 
Oct
24th
Mon
permalink

tip: sed

sed -e $’s/$/\r/’ mydos.txt to convert dos to unix linebreaks

tips  sed