Hacking with the quote command on Bash shell

ABOUT Quoting

Quoting is used to remove the special meaning of certain characters or words to the shell.  Quoting can
be used to disable special treatment for special characters, to prevent reserved words from being
recognized as such, and to prevent parameter expansion.

Each of the shell metacharacters (*note Definitions::) has special meaning to the shell and must be
quoted if it is to represent itself. When the command history expansion facilities are being used 
(*note History Interaction::), the HISTORY EXPANSION character, usually '!', must be quoted to prevent
history expansion.  *Note Bash History Facilities::, for more details concerning history expansion.

There are three quoting mechanisms: the ESCAPE CHARACTER, single quotes, and double quotes.

Escape Character

A non-quoted backslash '\' is the Bash escape character.  It preserves the literal value of the next
character that follows, with the exception of 'newline'.  If a '\newline' pair appears, and the backslash
itself is not quoted, the '\newline' is treated as a line continuation (that is, it is removed from the
input stream and effectively ignored).

Single Quotes

Enclosing characters in single quotes (''') preserves the literal value of each character within the
quotes.  A single quote may not occur between single quotes, even when preceded by a backslash.

Double Quotes

Enclosing characters in double quotes ('"') preserves the literal value of all characters within the
quotes, with the exception of '$', '`', '\', and, when history expansion is enabled, '!'.  
The characters '$' and '`' retain their special meaning within double quotes (*note Shell
Expansions::).  The backslash retains its special meaning only when followed by one of the following
characters: '$', '`', '"', '\', or 'newline'.  Within double quotes, backslashes that are followed by
one of these characters are removed.  Backslashes preceding characters without a special meaning are left
unmodified.  A double quote may be quoted within double quotes by preceding it with a backslash.  If
enabled, history expansion will be performed unless an '!' appearing in double quotes is escaped using a
backslash.  The backslash preceding the '!' is not removed.

The special parameters '*' and '@' have special meaning when in double quotes (*note Shell Parameter

$echo quote ls
quote ls
$echo ‘quote ls’
quote ls
$echo ‘quote ls`
> ;
> ^C
$echo `quote ls`
$echo `ls`
animal.png animal.xcf icon.png
animal.png animal.xcf icon.png
$ls `quote ls`
ls: cannot access ‘ls’: No such file or directory
$ls ‘quote `ls`’
ls: cannot access quote `ls`: No such file or directory
$echo ‘quote `ls`’
quote `ls`
$echo `quote `ls“
$echo "quote `ls`"
quote animal.png
$echo ‘quote `ls`’
quote `ls`
$echo ‘ls `ls`’
ls `ls`
$quote "ls pwd"
‘ls pwd’$
$quote "ls pwd \n"
‘ls pwd \n’$
$ls `quote ls`
ls: cannot access ‘ls’: No such file or directory
$ls `ls`
animal.png animal.xcf icon.png