[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to escape single quote?
From: |
Pierre Gaston |
Subject: |
Re: how to escape single quote? |
Date: |
Wed, 29 Dec 2010 13:04:12 +0200 |
On Wed, Dec 29, 2010 at 12:44 PM, ali hagigat <hagigatali@gmail.com> 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 "'" also works
3) then you reopen the single quote for the rest of your string '
It's not a form of quoting is 3 parts put together 'A' and \' and 'B'
Why echo 'ppp\'qqq' is not OK? It can not escape single quote by \ !
because \ is not special inside single quotes