I want to know the ruby version being run from a bash script.
That can be done with ruby -v:
$ ruby -v
ruby 1.9.3p545 (2014-02-24) [i686-linux] Brightbox
My problem is that I just want the version number. How do I transform that output into this?
1.9.3p545
p545important? If not, you could doruby -e 'puts RUBY_VERSION'ruby -e '$><<RUBY_VERSION'