Variables

C

Carl Yeksigian

How do you: get the OS variable that you are currently running on
- AND -
the name of the user that is running the application?
 
N

nobu.nokada

Hi,

At Wed, 13 Aug 2003 12:57:30 +0900,
Carl said:
How do you: get the OS variable that you are currently running on

What do you mean by "the OS variable"?
the name of the user that is running the application?

$ ruby -e 'p ENV["USER"]'
"nobu"
$ ruby -e 'p ENV["LOGNAME"]'
"nobu"
$ ruby -retc -e 'p Etc.getlogin'
"nobu"
 
B

Brian Candler

How do you: get the OS variable that you are currently running on

Do you mean:
$ ruby -e "p RUBY_PLATFORM"
"i386-freebsd4.8"

(this is the platform the ruby interpreter was compiled under, which may or
may not be the same thing)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,102
Messages
2,570,645
Members
47,246
Latest member
TemekaLutz

Latest Threads

Top