2

I need to run the following script when making a new docker image.

sh -c "$(curl -fsSL https://starship.rs/install.sh)" 

The above script asks me to proceed and I have to answer with y/N. How do I pipe 'y' into the above command, or is there a way to run without the confirmation?

Thanks.

3
  • Welcome, I would say just $(yes | curl -fsSL https://starship.rs/install.sh).CommentedFeb 11, 2022 at 14:38
  • @schrodigerscatcuriosity thanks. But your solution outputs ``` -bash: #!/usr/bin/env: No such file or directory ```CommentedFeb 11, 2022 at 14:56
  • @rowboat seems I had to add both --yes and --force. Putting either one alone didn't work.CommentedFeb 11, 2022 at 15:07

1 Answer 1

3

The solution was to not use piping, and instead add both force and yes options:

sh -c "$(curl -fsSL https://starship.rs/install.sh)" -y -f 
0

    You must log in to answer this question.

    Start asking to get answers

    Find the answer to your question by asking.

    Ask question

    Explore related questions

    See similar questions with these tags.