automate selection and press enter for simple bash script

51 views Asked by At

I would like to sush2 into a remote device then run commands, but the system requires the user to enter the letter "t" then press enter.

I would like to be able to paste the device hostname after script then have the script enter the letter "t" and "press" enter then execute commands I enter into the bash script after I am logged into the device.

How can I automate this process?

I tried echo "t"

I was hoping the echo command would work

This is how I execute the bash script:

[mydevserver ~]$ ./sush2v2.sh [hostname]

my script:

#!/bin/bash

host="$1"

sush2 "$host"

0

There are 0 answers