trying to create a file with following data using shell script.
InsertParam.sh
echo "$$Domain=XYZ" >parameter.prm
when i run InsertParam.sh Am getting out put as
$cat parameter.prm
1979205Domain=XYZ
Please help me how to over come this in my parameter.prm
i need Data as
$$Domain=xyz
In sh/bash/ksh/zsh
, $$
is the current PID. see https://www.gnu.org/software/bash/manual/bashref.html#Special-Parameters
You need to use different quotes to prevent that variable from being expanded:
echo '$$Domain=XYZ' >parameter.prm
see https://www.gnu.org/software/bash/manual/bashref.html#Quoting
Quotes can be mixed, as required:
echo '$$Domain='"$domain" >parameter.prm