pass wget output (streamed shell script) to bash, but with extra arguments

Viewed 1922

I'd like to download the specific file via wget, pass it as a bash script and in one shot also provide arguments for it.

In my case, the script is stored at: https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh

I've tried:

wget -O - https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh | bash

but it ends with:

Error: you need to provide a host and port to test.
Usage:
    bash host:port [-s] [-t timeout] [-- command args]
    -h HOST | --host=HOST       Host or IP under test
    -p PORT | --port=PORT       TCP port under test
                            Alternatively, you specify the host and port as host:port
    -s | --strict               Only execute subcommand if the test succeeds
    -q | --quiet                Don't output any status messages
    -t TIMEOUT | --timeout=TIMEOUT
                            Timeout in seconds, zero for no timeout
    -- COMMAND ARGS             Execute command with args after the test finishes

as I'd also need to pass arguments to this bash script (hostname and port to check in my specific case), namely I'd need to run something like:

wait-for-it.sh localhost:8181

UPDATE: I'd love to have the solution without local save (=> pipe to bash only please)

1 Answers
Related