I have the following line in my bash file:
LIST=$(ssh 192.168.0.22 'ls -1 /web');
The problem I am having is that it is a part of automated script and I often get this on the stdout and not the data I need:
ssh_exchange_identification: Connection closed by remote host
I realize that LIST only gets the stdout of the ls. So I am looking for a command that would get more of the info from the commands. In particular:
stdoutforls- I have that right nowstderrforls- not really interested, I don't expect a problem therestdoutforssh- Not interested, I don't even know what it would outputstderrforssh- THIS IS WHAT I AM LOOKING FOR to check whether itsshcorrectly. This being empty should mean that I have the data in$LISTI expect