【发布时间】:2009-06-18 12:11:41
【问题描述】:
我正在尝试更改 shell 的目录我通过 ruby 脚本本身启动 ruby 脚本表单...
我的意思是构建一个小程序来管理收藏夹目录并在它们之间轻松更改。
这就是我所做的
#!/usr/bin/ruby
Dir.chdir("/Users/luca/mydir")
and than tried executing it in many ways...
my_script (this doesn't change the directory)
. my_script (this is interpreted as bash)
. $(ruby my_script) (this is interpreted as bash too!)
有什么想法吗?
【问题讨论】: