Home > Net >  How to keep a bash script open with wget or curl while executing and piping it to bash
How to keep a bash script open with wget or curl while executing and piping it to bash

Time:08-14

I'm trying to execute a bin script directly from a remote repository using either wget or curl. However when I run wget -O - https://raw.githubusercontent.com/matriarx/typescript/main/bin/init | bash or curl -L https://raw.githubusercontent.com/matriarx/typescript/main/bin/init | bash it immediately closes off the script and exits it.

Inside that script I'm using a read command to get user input, but it never ends up reading the input and just exits the script before ever completing it.

How can I use the wget or curl commands to get the file, pipe it to bash and keep it running and open and fully complete the script before exiting.

CodePudding user response:

Try, with curl,

curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/matriarx/typescript/main/bin/init | sh
  • Related