[GLLUG] Bash scripting problem
Martin A. Brooks
martin at hinterlands.org
Tue May 16 14:34:25 UTC 2017
On 2017-05-16 15:28, Andy Smith via GLLUG wrote:
> Hi John,
>
> On Tue, May 16, 2017 at 03:21:44PM +0100, John Levin via GLLUG wrote:
>> What would be the best way to pass along to sed two strings like
>> "An ad to","An act to" ?
>
> Quote them.
>
> $ echo "An ad to" | sed -e "s/\bad\b/act/g"
> An act to
>
> http://wiki.bash-hackers.org/syntax/quoting
Or use perl, which is the swiss army knife for this kind of thing.
More information about the GLLUG
mailing list