[clug] Help with bash script

Peter Barker pbarker at barker.dropbear.id.au
Mon Nov 3 11:57:49 GMT 2008

On Mon, 3 Nov 2008, David Deaves wrote:

> Steve Jenkin wrote:
>> With Hard quotes, it's trivial to create *almost* any string - barring '
>> - the termination char.
>> Anyone got a nice way to do this??? [real question, not rhetorical]

> To create a string with a whole swag of special chars in it, including '
> do most of the specials inside 's then when you need a ', close the quoting 's
> then put the required ' inside "", eg.
> ff='+-_="'"'"
> echo $ff

Another option:
pbarker at apiomerus:~/bo$ ff=$(echo -e '+-_="\047')
pbarker at apiomerus:~/bo$ echo $ff
pbarker at apiomerus:~/bo$

> Dave !

Peter Barker                          |   Programmer,Sysadmin,Geek.
pbarker at barker.dropbear.id.au	      |   You need a bigger hammer.
:: It's a hack! Expect underscores! - Nigel Williams

More information about the linux mailing list