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

  • Home
  • SEARCH
  • 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 9240513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:12:09+00:00 2026-06-18T08:12:09+00:00

read -p Which server do you want to know about: read var_server echo $var_server

  • 0
read -p "Which server do you want to know about: "
read var_server
echo $var_server
for $var_server
  do
    $echo ping -a $var_server
    $ehco nmap -O $var_server
done

My script hangs on the “read var server” when i execute with sh -x, could anyone advise thanks. It just stops and sits on the

+ read var_server

Not sure where i am going wrong

Thanks
Bill

  • 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-06-18T08:12:10+00:00Added an answer on June 18, 2026 at 8:12 am

    You have two separate read calls. Combine them into one single call so you’re only prompted for one piece of information:

    read -p "Which server do you want to know about: " var_server
    

    Also the for loop is nonsensical. You’ve only got one server, there’s nothing to loop over, so delete the loop. Then you wrote $echo and $ehco instead of echo. So change the entire for loop to just these two lines:

    echo ping -a $var_server
    echo nmap -O $var_server
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a c++ server which is using boost::asio to do read/write operations -
I have a web server which is protected behind http-basic-auth. I've read through the
In C++, I've read some tutorials to create a server which can accept connections
I have a SQL Server database which I can read from, is there a
OK, so I read about drupal_write_record , which apparently serves as a function which
I have a desktop app that has 65 modules, about half of which read
I know there are plenty of questions here already about this topic (I've read
OK so I have read a fair amount about SQL Server's locking stuff, but
I was quite happy with my JSF app which read the contents of MQ
Using EF we can use LINQ to read data which is rather simple (especially

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.