To pass input from a local file to
ssh, you should use input redirection like this:
ssh user@server < abc.txt
Are you sure the
_ must be really a single character? In that case this is possible if
x is configured in
~/.ssh/config as an alias to some user@host:
ssh x < abc.txt
I cannot answer Q2 because I don't really understand it. I suppose Remote.txt is on the remote.
As per the second question, I suppose Remote.txt is a file on the remote side, in which case the command should be of the form:
ssh user@server "bash < Remote.txt"
...but this does not fit the problem description with
_ _ _ and of course to remove the trailing tabs some more would be necessary like:
ssh user@server "bash < <(sed -e 's/^[ ]*//' Remote.txt)"
In other words this does NOT answer the second question. I hope this helps you anyway understanding redirection when used with
After reading the Q another time, since it says "passing multiple lines of input to ssh" suggests that we have to use redirection to ssh again, in which case the file must be local.
ssh user@server < <(sed 's/^[ ]*//' Remote.txt)
But again, I don't think this qualifies as an answer in the form
ssh _ _ _ Remote.txt