Listing some useful sed / awk liners to use with MySQL. I use these on occasion.
sed, awk & grep have many overlapping features. Some simple tasks can be performed by either. For example, stripping empty lines can be performed by either:
grep '.' awk '/./' sed '/./!d' grep -v '^$' awk '!/^$/' sed '/^$/d'
It's a matter of taste & convention which tool and variation to use. So for any script I suggest, there may be many variations, possibly …[Read more...]