I'm trying to code a script where I can connect via telnet to another server and execute certain operations, but I'm having problems with the result of this process.The objective is to connect to a server, execute one command, and save the result into a .txt file. It is desirable that the parameters or input are in an input file .txt, which is read by the script and executed. (I have not done that part yet.)Here's what I have so far.#!/bin/bash{sleep 5echo usersleep 3echo passwordsleep 3echo clearecho COMMANDS >> /ROUTE/output_file.txtecho exit} | telnet 172.22.89.133In this case I'm getting the output file filled with the command, but obviously I need the result of that command. I know it is a little silly, but I've been trying in many ways and I am still getting the same result.How can I get this done?
Connect via telnet and doing certain operations
bash;shell script;io redirection;telnet