非常简单的安装自制程序的脚本:
#!/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
重定向标准输入,它根本不会提示。因此:
ruby \
-e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" \
</dev/null
这是yes
的用途:
yes
yes '' | ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
如果要求按回车键
为了更加清楚,请获取啤酒文档
Press enter
https://docs.brew.sh/
:
Per the lead maintainer of Homebrew
这对我来说很好,
echo | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"