Bypassing prompt (to press return) in homebrew install script

前端 未结 5 1589
灰色年华
灰色年华 2020-12-25 11:50

Very simple script that installs homebrew:

  #!/bin/bash

  ruby -e \"$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)\"

T

相关标签:
5条回答
  • 2020-12-25 12:24

    This is what yes is for:

    yes '' | ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
    
    0 讨论(0)
  • 2020-12-25 12:36

    Per the lead maintainer of Homebrew:

    echo | /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
    
    0 讨论(0)
  • 2020-12-25 12:40

    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
    
    0 讨论(0)
  • 2020-12-25 12:43
    Press enter 
    

    if it asks to press return key

    For more clarity of this,get hold of the brew docs

    https://docs.brew.sh/
    
    0 讨论(0)
  • 2020-12-25 12:46

    This works fine for me,

    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null
    
    0 讨论(0)
提交回复
热议问题