Last active
January 6, 2022 12:00
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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