如何将Ruby脚本中的环境变量导出到父shell?例如,实现readBash内置的天真实现:
read
#!/usr/bin/ruby varname = ARGV[0] ENV[varname] = STDIN.gets # but have varname exported to the parent process
ruby environment-variables
environment-variables ×1
ruby ×1