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.

Required fields*

2
  • 6
    With bash, use read -p 'some prompt' to provide a prompt for the user. The script in the question prints the prompt to standard output. Interactive prompts should be printed to standard error, which read -p does. Also, login is a poor choice of name for the function as it 1) does not log in, and 2) it overrides the existing login utility's name. Commented Feb 10, 2020 at 12:52
  • @Kusalananda the name login was just a testing one, I usually name my functions starting with f__. Thanks! Commented Feb 11, 2020 at 7:43