Artificial intelligent assistant

Bash: interactive remote prompt I have a script which connects to a remote server and check if some package is installed: ssh root@server 'bash -s' < myscript.sh myscript.sh: OUT=`rpm -qa | grep ntpdate` if [ "$OUT" != "" ] ; then echo "ntpdate already installed" else yum install $1 fi This example could be simplified. Here is `myscript2.sh` which has same problem: read -p "Package is not installed. Do you want to install it (y/n)?" choise My problem is that bash can not read my answers interactively. Is there a way to execute local script remotely without losing ability to prompt user?

Try something like this:


$ ssh -t yourserver "$(

The `-t` forces a tty allocation, `$(
If the script needs parameters, pass them after the script:


$ ssh -t yourserver "$(

Works for me, not sure if it's universal though.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy be8c4ac4769ca04679581bce478ecb77