Skip to content

Instantly share code, notes, and snippets.

@jaw6
Created October 29, 2012 16:27
Show Gist options
  • Select an option

  • Save jaw6/3974657 to your computer and use it in GitHub Desktop.

Select an option

Save jaw6/3974657 to your computer and use it in GitHub Desktop.
➜ java -version | wc
java version "1.6.0_35"
Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M3811)
Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode)
0 0 0
➜ echo "what" | wc
1 1 5
java_version = `java -version`
# java version "1.6.0_35"
# Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M3811)
# Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode)
# => ""
if java_version =~ /64-Bit Server VM/
puts "You have 64-bit java!" # this never happens
end
puts java_version
# => nil
>> ruby_version = `ruby -v`
# => "ruby 1.8.7 (2011-12-28 MBARI 8/0x6770 on patchlevel 357) [i686-darwin11.2.0], MBARI 0x6770, Ruby Enterprise Edition 2011.12\n"
@pjb3
Copy link

pjb3 commented Oct 29, 2012

$ java -version | wc 
java version "1.6.0_35"
Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M3811)
Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode)
       0       0       0
$ java -version 2>&1 | wc 
       3      18     157

@glv
Copy link

glv commented Oct 29, 2012

$ java -version 2>&1 | wc 
       3      18     156

@zerowidth
Copy link

java_version = `java -version 2>&1`
java -version 2>&1 | wc
       3      18     157

@zerowidth
Copy link

lol. welp.

@alindeman
Copy link

STDERR FTL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment