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 4084658
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:28:06+00:00 2026-05-20T18:28:06+00:00

I want to take the input from the user, which could be any of

  • 0

I want to take the input from the user, which could be any of the given options, I tried using select, but it just goes in loop, doesn’t come out, is there a way i can make it to come out and proceed after the user has entered right option, here is the sample code:

select envir in "prod" "uat" "dev"; do
    echo $envir
done

//continue with the script
echo "out of select"

Once user selects any of the available options, it should come out and continue with the scripts, if the user has entered anything else, it should keep on prompting.

  • 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-20T18:28:07+00:00Added an answer on May 20, 2026 at 6:28 pm

    From the bash(1) man page:

    … The list is executed
    after each selection until a break command is executed. The exit status of select is
    the exit status of the last command executed in list, or zero if no commands were exe-
    cuted. …

    In other words, execute a “break” statement when $envir is nonempty.

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

Sidebar

Related Questions

Requirement is like: I want to take input values from user in frame but
I want to write a script in AutoIt, which can take automatic input from
I want to take Input from the user as Big-Integer and manipulate it into
I want to add a Customized UIView that will take Text input from user.
I am trying to take a single input from the user and delete some
Java Question: I want to take an undetermined number of lines of input from
In my application, I need to take input from the user for a column
I want to take multiple integer inputs in same line eg :- input -1
I want to create an input form that will take the input text and
I want to define a method that take an integer as input and creates

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.