I have a bash script which internally calls a Ruby script, based on the situation sometimes the Ruby script will prompt for a user selection; how can I make this possible?
Main Bash script:
#!/usr/bash
for host_name in `./myruby.rb -a xxx -b xxx`
do
echo -e "$host_name"
done
wrapper myruby.rb
#!/usr/bin/ruby
.....
......
puts "enter your selection ?"
user_selection = $stdin.gets
If I run the Ruby directly, it's working fine, but when I run it from bash it's not prompting for user input; rather it's hanging.