plink not allowing interactive prompt

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

plink not allowing interactive prompt

Post by alex.barylski »

I am starting a plink session from a Windows match file. Everything logs in and the remote bash script I invoke is being executed -- works fine.

However I need to prompt the user for a single input from within the shell script on the Linux server.

The script works when run from the CLI under linux but under windows when invoked through plink I get prompted but the screen freezes and nothing works.

This is the Windows batch code:

Code: Select all

 
@ECHO OFF
 
:BEGIN
 
START plink.exe 192.168.1.199 -l root -pw test sh /root/site_down
 
:END
 
This is the shell script

Code: Select all

 
#!/bin/bash
 
echo "Enter the number of hours the site will be down: "
read -e HOURS
echo "Site down for $HOURS hours"
 
I'm not sure why this doesn't work -- if I invoke putty without user/pass it successfully prompts me -- any ideas?
Post Reply