ruby 调用Linux 系统环境变量,比如
#!/usr/bin/env rubyuser = ENV['USER']hostname = ENV['HOSTNAME']puts "current user is #{user}"puts "current hostname is #{hostname}"
本文共 201 字,大约阅读时间需要 1 分钟。
ruby 调用Linux 系统环境变量,比如
#!/usr/bin/env rubyuser = ENV['USER']hostname = ENV['HOSTNAME']puts "current user is #{user}"puts "current hostname is #{hostname}"
转载于:https://blog.51cto.com/purplegrape/1891555