Shellwords.Shellescape Implementation for Ruby 1.8

Shellwords.shellescape implementation for Ruby 1.8

I wound up going with the Escape gem, which has the additional feature of using quotes by default, and only backslash-escaping when necessary.

How to hide password input from terminal in ruby script

Best method from @eclectic923's answer:

require 'io/console'
password = STDIN.noecho(&:gets).chomp

For 1.9.3 (and above), this requires you adding require 'io/console' to your code.

Original Answer:

Ruby "Password" is another alternative.



Related Topics



Leave a reply



Submit