I am trying to run a few commands through
ssh and getting confused with the behavior of
ssh myhost sh -c 'echo starting; who -b; date; echo $SHELL'
Output (note: the echo's output is just a blank line!)
system boot 2016-12-22 20:22 Thu Jan 26 06:12:52 UTC 2017 /bin/bash
sh -c I get the correct output:
ssh myhost 'echo starting; who -b; date; echo $SHELL'
starting system boot 2016-12-22 20:22 Thu Jan 26 06:18:28 UTC 2017 /bin/bash
- Why doesn't
sh -chandle the
echo startingcommand correctly? It outputs a blank line.
- Why is SHELL set to