I’m executing commands remotely through ssh. Is it possible to send output or commands to my own shell? (not to remote)
For example, I wanted to use colored output. I didn’t mind having the echo’s executed remotely too. But it seems like remote machine does not recognize the syntax and throws errors.
ssh myapp "
mkdir /some/dir || echo "$(tput setaf 1)ERROR$(tput sgr0)"
"
Maybe you need to escape your remote command correctly: