trivial-ssh
trivial-ssh copied to clipboard
ssh:with-command does not work is remote connection is using a c shell
How to replicate
Connect to a remote host as a user who uses the c shell (or tcsh).
(flet ((read-lines (s)
(loop for line = (read-line s nil nil)
while line
collect line)
(ssh:with-connection (conn "julian" (ssh:agent "thawes"))
(ssh:with-command (conn iostream "ls -al")
(read-lines iostream))))
Expected Behavior
Get a list of files.
What happens instead
The stream is empty (and still returns 0) but there is now a file on the remote host called 1
with the expected output (list of files).
I tried this with various shells and it seems to only happen if the remote shell is csh or a derivative of csh. I don't have this problem with any bourne compatible shells. /bin/sh bash and ksh all work as expected.