Re: Replacing with quotes the ${x/y/z} way.
From: Chris F.A. Johnson (c.fa.johnson_at_rogers.com)
Date: 12/30/03
- Next message: Bill Marcum: "Re: Replacing with quotes the ${x/y/z} way."
- Previous message: joe_at_invalid.address: "Re: High latency shell environment"
- In reply to: Mark June: "Replacing with quotes the ${x/y/z} way."
- Next in thread: Mark June: "Re: Replacing with quotes the ${x/y/z} way."
- Reply: Mark June: "Re: Replacing with quotes the ${x/y/z} way."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 30 Dec 2003 18:45:07 GMT
On Tue, 30 Dec 2003 at 02:31 GMT, Mark June wrote:
> Hello,
>
> I have a problem. I do:
>
> $ PS2="> "
>
> $ a=1
>
> $ echo "'"
> '
>
> According to that above, "${a/1/'}" should replace 1 with one single
> quote but:
>
> $ echo "${a/1/'}"
> > bash: unexpected EOF while looking for matching `''
> bash: syntax error: unexpected end of file
>
> And if I try protecting the single quote during the job it does:
>
> $ echo "${a/1/\'}"
> \'
>
> How could I get that 1 replaced with one single quote using that
> method?
q="'"
echo "${a/1/$q}"
--
Chris F.A. Johnson http://cfaj.freeshell.org
===================================================================
My code (if any) in this post is copyright 2003, Chris F.A. Johnson
and may be copied under the terms of the GNU General Public License
- Next message: Bill Marcum: "Re: Replacing with quotes the ${x/y/z} way."
- Previous message: joe_at_invalid.address: "Re: High latency shell environment"
- In reply to: Mark June: "Replacing with quotes the ${x/y/z} way."
- Next in thread: Mark June: "Re: Replacing with quotes the ${x/y/z} way."
- Reply: Mark June: "Re: Replacing with quotes the ${x/y/z} way."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|