安装homebrew的非常简单的脚本:
#!/bin/bash ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
输出给出:
==> This script will install: /usr/local/bin/brew /usr/local/Library/... /usr/local/share/man/man1/brew.1 Press RETURN to continue or any other key to abort
如何在这样的脚本中按Enter键?期望是最好的路线?
读取
https://raw.github.com/Homebrew/homebrew/go/install的来源 – 它只会提示是否stdin是TTY.如果从/ dev / null重定向stdin,它根本不会提示.所以:
原文链接:https://www.f2er.com/bash/383629.htmlruby \ -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" \ </dev/null