本文介绍了在自制绕过提示(preSS回报)安装脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
很简单的脚本,安装自制软件:
Very simple script that installs 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
我如何preSS在这样的输入脚本?所期望的是最佳路线?
How do I press enter in a script like this? Would expect be the best route?
推荐答案
阅读的https://raw.github.com/Homebrew/homebrew/go/install - 如果标准输入是一个TTY它只是提示。如果您重定向从的/ dev / null的
标准输入,它不会提示的。所以:
Reading the source of https://raw.github.com/Homebrew/homebrew/go/install -- it only prompts if stdin is a TTY. If you redirect stdin from /dev/null
, it won't prompt at all. So:
ruby \
-e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" \
</dev/null
这篇关于在自制绕过提示(preSS回报)安装脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!