[GLLUG] Bash scripting problem

Andy Smith andy at bitfolk.com
Tue May 16 19:35:53 UTC 2017


Hi John,

On Tue, May 16, 2017 at 06:10:39PM +0100, John Levin wrote:
> On 16/05/2017 15:28, Andy Smith via GLLUG wrote:
> >$ echo "An ad to" | sed -e "s/\bad\b/act/g"

> Many thanks for this, presume the \b mean \ before the space.

'\b' matches word boundaries:

http://stackoverflow.com/questions/1032023/sed-whole-word-search-and-replace

Cheers,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting



More information about the GLLUG mailing list