3

I'm using bash shell on Amazon Linux. I have a command in a shell script

wget -O - "http://localhost:8088/subco/books/$e_id/segments/$segment_id?product=$product_id&audience=teacher" > /dev/null 

Reading this -- https://superuser.com/questions/321240/how-do-you-redirect-wget-to-standard-out/321241, I was led to believe I could output the result of wget (what it retrieves) to my screen and suppress all other output. However instead, what I get is

--2018-05-29 18:39:49-- http://localhost:8088/subco/books/C2644BB08F394E209A26175BD2C89F5A/segments/C2F62E7002964DD396E381DB331129A4?product=D399B9C5F6204EDE80A002930CC0D02F&audience=teacher Resolving localhost (localhost)... 127.0.0.1 Connecting to localhost (localhost)|127.0.0.1|:8088... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/html] Saving to: ‘STDOUT’ 

How do I output the result of wget to the screen and suppress all other information (e.g. like the "HTTP request sent, awaiting response... 200 OK" part)?

0

1 Answer 1

5

If you want to use wget, the use -qO -

wget -qO - google.com 

Or you could use curl with no options

curl google.com

And if you want to go a little further and parse results etc, the package BeautifulSoup for Python is great.

2
  • thanks for the curl suggestion, it's the perfect tool for my use case. Commented Jan 5, 2021 at 15:41
  • what if you want to issue a POST request? Commented Nov 2, 2021 at 9:37

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.