<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><br><div>> Date: Fri, 31 Oct 2014 20:15:18 -0400<br>> From: rogerx.oss@gmail.com<br>> To: abcde-users@lists.einval.com<br>> Subject: Re: [Abcde-users] post_encode won't allow user input?<br>> <br><snip><br>><br>> I'd really like to see that one big blob main routine which is entirely piped <br>> into another blob cleaned up towards the end of abcde; so people can more <br>> easily trace code, color syntax will properly work within VI/VIM, and people <br>> can add more of their own functions without worrying about that blob.  (ie.  <br>> That large block of code should look more like "my routine" | "piped into <br>> another routine" at the very least instead of piping 100-200 quoted lines into <br>> another 100-200 quoted lines. ;-)<br>><br><snip><br><br>Thanks Roger. You got me looking in the right direction. I hadn't noticed that that's how the main body of the script was run (piped subshells). That answered the "why"; because stdin was being taken from the pipe from the previous subshell. Once I knew the right question to ask, I got help from Superuser:<br><br><a href="http://superuser.com/questions/834502/possible-to-get-a-bash-script-to-accept-input-from-terminal-if-its-stdin-has-bee" target="_blank">http://superuser.com/questions/834502/possible-to-get-a-bash-script-to-accept-input-from-terminal-if-its-stdin-has-bee</a><br><br>To summarize, if you want to accept user input in the scripts, redirect stdin from /dev/tty, e.g.:<br><br>-----<br>read -p "Gimme some stuff: " stuff </dev/tty<br>-----<br><br>or<br><br>-----<br>select stuff from 1 2 3<br>do<br>    echo "$stuff"<br>    break<br>done </dev/tty<br>-----<br></div>                                        </div></body>
</html>