LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to invoke a script downloaded with curl and pass invocation options? (https://www.linuxquestions.org/questions/linux-general-1/how-to-invoke-a-script-downloaded-with-curl-and-pass-invocation-options-4175683211/)

framp 10-05-2020 03:16 PM

How to invoke a script downloaded with curl and pass invocation options?
 
I have no idea which forum would be appropriate for my question so I just picked this one :-)

Right now I use following code to download and call a small bash script from my website which initiates a more complex installation

"curl https://<mydomain>/install | sudo bash"

which works fine. Now I want to pass installation options the the install script. I tried

"curl https://<mydomain>/install -o | sudo bash"

which fails.

As a workaround I can use

"curl https://<mydomain>/install -O ./install && sudo ./install -o"

but I frankly would like to use the first version just by adding option -o somewhere :)

Is there any way to get this done or do I have to use the workaround?

berndbausch 10-05-2020 04:59 PM

Try the -s option.
Code:

curl https://<mydomain>/install | sudo bash -s -- -o
The double-dash terminates the list of bash options.

framp 10-07-2020 02:38 PM

You made my day. -s Works perfectly :thumbsup:


All times are GMT -5. The time now is 11:30 AM.