[SATLUG] sed and Regular expression question

Frank Huddleston fhuddles at gmail.com
Sat Mar 16 19:06:18 CDT 2013


ed can use up to 9 back references. \(foobar\) \1

sed -e 's/Variation_\([0-9]*\)G/Variation_\1G-/g'

Thanks, Don: that's exactly what I wanted: "back references".
As to why I didn't just search and replace for "G": yes, that's what I did, and it worked: this time. But I figured I might as well find out how to do it with the back references: it could come in handy.

Thanks again,

Frank Huddleston

More information about the SATLUG mailing list