On Wed, Dec 29, 2010 at 1:28 AM, ali hagigat wrote:
> I wonder if anybody knows how to escape a single quote character by
> /bin/sh or bash?
> echo 'ppp\'qqq''
> ppp\qqq
> Please look at the above example and the result.
> Regards
>
>
echo "ppp'qqq"
or
echo 'ppp'\''qqq'
Dennis,
Nice. Much appreciated
What logic is it using you think when we use echo 'ppp'\''qqq'?
Why echo 'ppp\'qqq' is not OK? It can not escape single quote by \ !
On Wed, Dec 29, 2010 at 1:11 PM, Dennis Williamson
wrote:
> On Wed, Dec 29, 2010 at 1:28 AM, ali hagigat wrote:
>> I wonder if anyb
On Wed, Dec 29, 2010 at 12:44 PM, ali hagigat wrote:
> Dennis,
>
> Nice. Much appreciated
> What logic is it using you think when we use echo 'ppp'\''qqq'?
>
The logic is:
1) you need to close the quotes with '
2) concatenate a single quotes using another form of quoting for instance:
\' but "'"
Chet Ramey wrote:
Arithmetic expansion is a Posix invention. It's treated just like every
other expansion: split unless double quoted. There's no compelling
reason to make it behave differently.
I don't want it to behave differently :)
Okay, so it's just "as is", because by consistent desig