In certain situations, quotes are required to be output in the command prompt. To do this, you may say why don’t use single quotes. Basically, that is able to handle most cases. However, single quotes prevent parsing environment variables. In this blog, we present a simple way to handle outputing quotes while parsing specifiled environment variables.
Firstly, we use single quotes:
echo 'hello "margin"'
the output showing below:
Try to display environment variables:
echo '"hello $PATH"'
If we prefer the content of PATH!
echo '"'hello $PATH'"'
result is :
Pay your attention on the first 3 characters after
echo, and the last 3 characters! They are
Do I make sense? Have any question? Do not hesitate to ask me~