osx bash上的ruby – tree命令

前端之家收集整理的这篇文章主要介绍了osx bash上的ruby – tree命令前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在跟着一个名为 pry的红宝石宝石的 screen cast。在8:10,使用了.tree命令,我相信这是一个Unix命令。

它似乎在我的系统上工作:

  1. [24] pry(main)> .tree
  2. \Error: there was a problem executing system command: tree

我已经将问题追溯到here,其中pry引用了一个shell命令:

  1. Pry::CommandSet.new do
  2.  
  3. command(/\.(.*)/,"All text following a '.' is forwarded to the shell.",:listing => ".<shell command>") do |cmd|
  4. if cmd =~ /^cd\s+(.+)/i
  5. dest = $1
  6. begin
  7. Dir.chdir File.expand_path(dest)
  8. rescue Errno::ENOENT
  9. output.puts "No such directory: #{dest}"
  10. end
  11.  
  12. else
  13. if !system(cmd)
  14. output.puts "Error: there was a problem executing system command: #{cmd}"
  15. end
  16. end
  17. end

从bash的上下文我尝试使用没有运气的命令树:

  1. projects/sms(apps2)$ tree
  2. -bash: tree: command not found
  3. ~/projects/sms(apps2)$ .tree
  4. -bash: .tree: command not found

这看起来非常有用,我该如何得到这个命令?

使用 homebrew

酿造安装树

使用macports

sudo端口安装树

使用the source

Follow these directions.(注意事项;你应该使用有意义的标志/等)

< rant>所有系统都应该带有树;我用了很多我们可以将目录结构作为文本发布,而不是图片。< / rant>

猜你在找的Bash相关文章