Skip to content

Instantly share code, notes, and snippets.

@stefan-vatov
Last active January 6, 2022 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stefan-vatov/45d9e07a4a112c9452a905d38e4aff66 to your computer and use it in GitHub Desktop.
Save stefan-vatov/45d9e07a4a112c9452a905d38e4aff66 to your computer and use it in GitHub Desktop.
[std in user input bash] Re-enable user input in case stdin is already redirected
# Source: https://stackoverflow.com/questions/6561072/why-wont-bash-wait-for-read-when-used-with-curl
read git_name < /dev/tty # per-command I/O redirection
#read git_name < /dev/console # alternative
exec 0</dev/tty # script-wide I/O redirection
read git_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment