#Remove everything between and including () and replace the original file with that content
sed -i '' "s/([^)]*)//g" <FileName>
#Remove control characters and colour codes from script output
sed -i -e 's/\x1b\[.\{1,5\}m//g' <FileName>
#Insert tab at beginning of lines.
#Useful in output is going in to a job spec
sed -i 's/^/\t\t/' <filename>
| # | Change | User | Description | Committed | |
|---|---|---|---|---|---|
| #3 | 25961 | Jen Bottom | Added another useful sed example | ||
| #2 | 25960 | Jen Bottom | Adding another useful sed example | ||
| #1 | 25707 | jen | Adding .p4ignore file | ||
| //guest/jen_bottom/scripts/useful_sed_examples | |||||
| #1 | 25542 | Jen Bottom | Ading some useful sed examples | ||