Tuesday, February 9, 2016

BASH replace whole word

Below tested on Linux, GNU bash, version 4.3.30(1)
$ export abc="logs           logs_andev     logs_anqa      logs_anuat     logs_csdQA     logs_svn       logs_TRAINING logs"


$ echo $abc |sed "s/\blogs\b//g"

It doesn't work on Solaris 11, GNU bash, version 4.1.11(1)

Monday, February 1, 2016