我正在关注一个名为pry的红宝石宝石上的屏幕投射。在 8:10,使用了 .tree 命令,我认为这是一个 Unix 命令。
它似乎不适用于我的系统:
[24] pry(main)> .tree
\Error: there was a problem executing system command: tree
我已经将问题追溯到这里,其中 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 的上下文中,我尝试使用命令树但没有运气:
projects/sms(apps2)$ tree
-bash: tree: command not found
~/projects/sms(apps2)$ .tree
-bash: .tree: command not found
这看起来非常有用,我怎样才能得到这个命令?