I want the hostname of a remote serve to use in my script. I am trying this command in script but it is not working.
#!/bin/bash host= $(ssh -i keylocation [email protected] sudo echo $HOSTNAME) echo $host
It is giving me the following error: ./changeconfig.sh: line 3: hostname(The actual host): command not found
Can anyone please help me out.