Re: bash-3 incompatibility: quoting in pattern substitution of variables
From:
Stephane Chazelas
Subject:
Re: bash-3 incompatibility: quoting in pattern substitution of variables
Date:
Mon, 6 Sep 2004 13:07:00 +0100
User-agent:
Mutt/1.5.6i
On Mon, Sep 06, 2004 at 01:35:49PM +0200, koenig@science-computing.de wrote:
[...]
> how to I replace all '?' by ' ' in a shell variable
> in a _portable_ way which works both in bash-2 and bash-3 ???
[...]
pattern='\?'
echo "${variable//$pattern/replacement}"
Seems to work with both versions.
--
Stephane
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________