Wednesday, 15 January 2014

ruby - Erroneously using STDIN when pasting a script into the Terminal.app -



ruby - Erroneously using STDIN when pasting a script into the Terminal.app -

i have next script-snipped, utilize regularly semi-automate 1 of workflows. open bash terminal , start irb , paste script:

require 'highline/import' # ... user = ask("user:") repo = ask("repository:") # ... # advanced fancy stuff

now want able paste terminal, first prompt user overwritten next line: repo = ask("repository:").

is there way prevent behaviour.

i know write script.

i find convenient able paste terminal i wonder how stdin can somehow outfoxed in case

is there way prevent behaviour.

you can prevent echoing of pasted text command

stty -echo

- whether question, since inevitably prevents echoing of typed-in commands, can see 1 time again after entering

stty echo

ruby osx bash irb highline

No comments:

Post a Comment