The following is working as expected. The only problem is that it does not return the source server command prompt unless I hit Ctrl + c
[abc@server]$ 0</dev/null echo "ls" | ssh -t -t email@example.com "sh" tcgetattr: Invalid argument sh-3.2$ xyz.tar.gz sh-3.2$ Killed by signal 2. [abc@server]$
I want to use it in shell script.