[PLUG] Sed syntax error [RESOLVED]

Rich Shepard rshepard at appl-ecosys.com
Tue Nov 15 19:19:25 UTC 2016


On Tue, 15 Nov 2016, Robert Citek wrote:

> $ <<< '1996/03/10' sed -re 's#([0-9]{4})/([0-9]{2})/([0-9]{2})#\1-\2-\3#g'
> 1996-03-10

Robert,

   Yep. This works. I wondered whether my books are out of date and I did not
need the escape parentheses and brackets.

> This is why you want to KISS -- use tr, if possible.

   Reading the man page I don't see how to use tr on a file or limit its use
to only the date field. Will look for more detailed explanation.

Thanks,

Rich



More information about the PLUG mailing list