LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-05-2020, 03:16 PM   #1
framp
Member
 
Registered: Apr 2003
Location: Next to Stuttgart, Germany
Distribution: Debian, Mint, Raspbian
Posts: 131
Blog Entries: 5

Rep: Reputation: 27
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?
 
Old 10-05-2020, 04:59 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Try the -s option.
Code:
curl https://<mydomain>/install | sudo bash -s -- -o
The double-dash terminates the list of bash options.

Last edited by berndbausch; 10-05-2020 at 05:02 PM.
 
1 members found this post helpful.
Old 10-07-2020, 02:38 PM   #3
framp
Member
 
Registered: Apr 2003
Location: Next to Stuttgart, Germany
Distribution: Debian, Mint, Raspbian
Posts: 131

Original Poster
Blog Entries: 5

Rep: Reputation: 27
Thumbs up

You made my day. -s Works perfectly
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Slackware ARM 14.2 - Updates Rollback - curl-7.57.0 - curl-7.58.0 abga Slackware - ARM 13 02-02-2018 11:44 AM
CentOS 6.7 has really OLD curl. Best way to update curl? sneakyimp Linux - Server 4 04-26-2016 03:06 PM
[SOLVED] cURL utility to post http payload to invoke the API boby.kumar Linux - Newbie 6 11-02-2015 08:48 AM
Best way to invoke gcc with many standard warning flags/options? keithostertag Programming 4 02-02-2012 04:21 PM
cURL: Server has many IPs, how would I make a cURL script use those IPs to send data? guest Programming 0 04-11-2009 11:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration