Pseudo-terminal will not be allocated because stdin is not a terminal
I have been using similar script as of above for long. I login on remote devices, have some commands ran on them and then logout. I use telnet and ssh both for remote login. so far all the commands are being echo-ed to remote terminals and the output being saved to some log files. what I need is to be able to interpreter the output generated by the remote terminal. Consider following a command sent to remote terminal after successful login via SSH/Telnet:
echo "show system date"
after running above command, I want to store the output generated by remote machine in a variable and perform some if/else statements. So far, I didn't have any kind of success. can someone please guide me how I can save the output generated by remote terminal in a variable?