[PLUG] Fun sed challenge!
David Fleck
david.fleck at mchsi.com
Fri Nov 17 01:40:43 UTC 2017
On Thu, 2017-11-16 at 04:48 -0800, Russell Senior wrote:
> Nice, that's a notch better than I came up with. But, sadly, it
> still
> munges the timestamps with leading zeros in minutes and seconds.
Oops, didn't notice the timestamp. How about:
cat testline | sed -e 's/ \(..\):\(..\):\(..\) /x\1x\2x\3x/' -e
's/:0/:/g' -e 's/:0/:/g' -e 's/:0/:/g' -e 's/:0/:/g' -e 's/:::*/::/g'
-e 's/x\(..\)x\(..\)x\(..\)x/ \1:\2:\3 /'
> _______________________________________________
PLUG mailing list
PLUG at pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug
More information about the PLUG
mailing list