I've never used it but you should take a look at 'expect', as in "man 
expect".

I also did "man bash" went down to "SHELL BUILTIN COMMANDS" to read 
about read ;-) and found "read -n nchars". Maybe that will work?

Austad, Jay wrote:
> So, say I have a shell script, that looks like this
> 
> echo -n "User:"
> read
> echo -n "Pass:"
> read
> /usr/sbin/someproprietaryprogram
> break
> 
> 
> And this script runs from inetd listening on some arbitrary port, say 40000.
> The username and password do not matter, I just ask for them and wait for a
> response because the remote program that connects to port 40000 needs it.  I
> know this isn't the most secure way to do this, but it's locked down with
> iptables rules and it's internal only. 
> 
> So anyway, this remote program sends the username after it sees the user
> prompt, and then sends a linefeed.  "read" expects a CRLF.  So, I either
> need to figure out how to make read just expect an LF, or convert this to
> perl and make that handle it properly.
> 
> I'm assuming if I did it in perl I'd just have a loop that read every
> character, and broke out of the loop when it saw an LF.  Right?
> 
> -jay
> 
> _______________________________________________
> TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
> http://www.mn-linux.org tclug-list at mn-linux.org
> https://mailman.real-time.com/mailman/listinfo/tclug-list
> 
> 

-- 
Eric (Rick) Meyerhoff
rick at eworld3.net
952-929-1659


_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
http://www.mn-linux.org tclug-list at mn-linux.org
https://mailman.real-time.com/mailman/listinfo/tclug-list