我正在追踪一颗名为pry的Ruby 上的screen cast.8点10分,飞机起飞.使用了tree命令,我认为这是一个Unix命令.
它似乎不适用于我的系统:
[24] pry(main)> .tree
\Error: there was a problem executing system command: tree
我把这个问题追溯到了here,其中pry引用了一个shell命令:
Pry::CommandSet.new do
command(/\.(.*)/, "All text following a '.' is forwarded to the shell.", :listing => ".<shell command>") do |cmd|
if cmd =~ /^cd\s+(.+)/i
dest = $1
begin
Dir.chdir File.expand_path(dest)
rescue Errno::ENOENT
output.puts "No such directory: #{dest}"
end
else
if !system(cmd)
output.puts "Error: there was a problem executing system command: #{cmd}"
end
end
end
在bash的上下文中,我try 使用命令树,但没有成功:
projects/sms(apps2)$ tree
-bash: tree: command not found
~/projects/sms(apps2)$ .tree
-bash: .tree: command not found
这看起来非常有用,我怎么能得到这个命令?