Saturday, May 4, 2024
9
rated 0 times [  9] [ 0]  / answers: 1 / hits: 11557  / 2 Years ago, tue, january 18, 2022, 9:27:21

I'm getting familiar with the terminal commands, and I came across this command to install the Heroku toolbelt:



wget -qO- https://toolbelt.heroku.com/install.sh | sh


Now from here I gather that wget is used to download files from the internet through various supported protocols, and they'll download even if I logoff.



Is that right?



And I wanted to know two more things about that command :




  1. I see -q0- in the code. What does it mean? From manpages I see that -q is used to turn the output of Wget off. But what does that mean too? And how is using -q different from -q0-


  2. What is the |sh at the end of the command for? What does that do?




Thank you very much for the time!


More From » installation

 Answers
1

That command actually is wget -qO not wget -q0.



It will download the file https://toolbelt.heroku.com/install.sh silently (-q option) and anything downloaded will be will be concatenated together and written to a single file buffer file (-O option), that downloaded buffer will then be pipped to and executed with sh.



sh is a shell interpreter that will run the information that wget just downloaded.



So, in simple words you are telling with this command: download this sh file and don't create a progress output and whatever you download execute it with sh.


[#36562] Thursday, January 20, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
egantfis

Total Points: 406
Total Questions: 108
Total Answers: 108

Location: Austria
Member since Thu, Jan 7, 2021
3 Years ago
egantfis questions
Mon, Nov 1, 21, 03:37, 3 Years ago
Fri, Mar 18, 22, 23:26, 2 Years ago
Mon, Mar 6, 23, 05:03, 1 Year ago
Sun, Oct 3, 21, 23:30, 3 Years ago
Thu, Mar 10, 22, 12:28, 2 Years ago
;