From: John Maclean Date: 2006-02-12T04:15:17+09:00 Subject: Re: Determining system information Thanks for that reply. In response to your tip I writen the following:-- (Note that the stuff below #== is only shown by irb and not when run in a shell) #!/usr/bin/ruby -w puts "\e[2J\e[0;0H" puts "**** quick system check **** " puts "your user name is #{ENV['USER']}" puts "your home dir is #{ENV['HOME']}" puts "ssh environ is #{ENV['SSH_AGENT_PID']}" puts "hostname is #{ENV['HOSTNAME']}" puts "history size is #{ENV['HISTSIZE']}" puts "path is #{ENV['PATH']}" puts "your shell is #{ENV['SHELL']}" puts "window manager is #{ENV['DESKTOP_SESSION']}" puts "current working dir is #{ENV['PWD']}" puts "language environment is #{ENV['LANG']}" puts puts require 'rbconfig.rb' include Config CONFIG["host"] CONFIG["libdir"] # =================================================== puts "your terminals have #{ENV['LINES']} lines and #{ENV['COLUMNS']} columns" puts "#{ENV['LINES']} #{ENV['COLUMNS']} " puts "your ruby lib is #{ENV['RUBYLIB']}" puts "config is #{ENV['CONFIG']}" puts "your dln path is #{ENV['DLN_LIBRARY_PATH']}" puts "your ruby shell is #{ENV['RUBYSHELL']}" puts "your ruby options are #{ENV['RUBYOPT']}" puts "path to ruby TCL shared library or DLL #{ENV['RUBY_TCL_DLL']}" puts "your ruby path is #{ENV['RUBYPATH']}" On Sun, 12 Feb 2006 02:20:10 +0900 John Maclean wrote: > Chaps, > > Running ENV in irb displays the system's environment. I've tried the > same thing in a script. What's missing here? > > #!/usr/bin/ruby -w > stuff = %w{ENV RUBY_VERSION RUBY_RELEASE_DATE RUBY_PLATFORM VERSION} > stuff.each{|foo| foo} > -- John Maclean MSc (DIC) 07739 171 531