I have the following script-snipped, which I use regularly to semi-automate one of my workflows. I open a bash terminal and start irb and then paste the script:
require 'highline/import'
# ...
user = ask("User:")
repo = ask("Repository:")
# ...
# Do advanced fancy stuff
Now I want to be able to paste this into the terminal, but the first prompt for the user is overwritten by the following line: repo = ask("Repository:")
.
Is there a way to prevent this behaviour.
I know that I could write a script. But
- I find it convenient to be able to just paste this into the terminal
- I wonder how the STDIN can be somehow outfoxed in this case