Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1034911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:27:58+00:00 2026-05-16T14:27:58+00:00

I am trying to create a script that will run wget to a few

  • 0

I am trying to create a script that will run wget to a few sites and check if we receive a 200 OK from the site.

My problem is that the result of wget application is shown in the stdout. Is there a way I can hide this.

My current script is:

RESULT=`wget -O wget.tmp http://mysite.com 2>&1`

Later I will use regex to look for the 200 OK we receive from the errout that wget produces.
When I run the script, it works fine, but I get the result of the wget added between my echos.

Any way around this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T14:27:58+00:00Added an answer on May 16, 2026 at 2:27 pm

    You can use:

    RESULT=`wget --spider http://mysite.com 2>&1`
    

    And this does the trick too:

    RESULT=`wget -O wget.tmp http://mysite.com >/dev/null 2>&1`
    

    Played around a little and came up with that one:

    RESULT=`curl -fSw "%{http_code}" http://example.com/ -o a.tmp 2>/dev/null`
    

    This outputs nothing but “200” – Nothing else.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a script that will run a program on each
Trying to create a script that will send a 'sh run | b interface'
Im trying to create a script that will post a notification stored in a
I'm trying to create a script that will automatically select In Person Interview in
I've been trying to create a script for myself that will allow me to
I'm trying to create a script with GD library that will take an uploaded
I'm trying to write a script that will create a user in MediaWiki, so
I'm trying to write a custom powershell script that will create a local user
I'm trying to create a script that will allow me to monitor CPU Utilization,
I'm trying to use Autohotkey to create a script that will Mute the computer's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.