Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • read is reading from standard input -- you've redirected the first parameter to the script ($1) as standard input, so it isn't the keyboard any more. You can't use read to read from both the file and from the keyboard at the same time. Commented Jul 5, 2018 at 14:49
  • Is there a way to temporarily redirect the input back to stdin if "prompt" is found? Commented Jul 5, 2018 at 14:51