2008年5月3日 星期六

environment variable

ENV[‘HOME’] (for unix-like)

ENV[‘HOMEDRIVE’]+ ENV[‘HOMEPATH’] (for windows)

return the path of home directory

ex:

on my mac , output is “/Users/Pan”




ARGV

the parameter to the ruby program

ex:

ruby test.rb  123

ARGV[0]  is 123


沒有留言: