How can I print $$PARAMTER_NM=1234
in a Linux shell? I am getting the PID of my current process with $$
, so the output is like:
1943PARAMTER_NM=1234
But I need:
$$PARAMTER_NM=1234
How can I print $$PARAMTER_NM=1234
in a Linux shell? I am getting the PID of my current process with $$
, so the output is like:
1943PARAMTER_NM=1234
But I need:
$$PARAMTER_NM=1234
You can protect the contents of the string from the shell in two possible ways:
Escape each $
like \$
:
echo "\$\$PARAMTER_NM=1234"
Use single quotes:
echo '$$PARAMTER_NM=1234'
# echo "\$\$PARAMTER_NM=1234"
$$PARAMETER_NM=1234
If you want to use a special/reserved character with double quotes (such as $) as-is - you need to use an escape character ('\') right before it.