I try to add the hostname of my server in a file but it fails. I tried:
HOST=`hostname`
echo ' "server": "${HOST}"' >> /myfile
And I tried:
echo ' "server": "`hostname`"' >> /myfile
It's important to know that I need this output in my file:
"server": "ip-133..."
Try this:
$ echo "\"server\": \"$(hostname)\"" >> myfile