Find the answer to your Linux question:
Results 1 to 2 of 2
hey, lookin for some advice, I am getting the user to input a letter, A or B, I only want the user to type in A or B, so how ...
  1. #1
    Just Joined!
    Join Date
    Nov 2011
    Posts
    3

    until loop

    hey, lookin for some advice, I am getting the user to input a letter, A or B, I only want the user to type in A or B, so how would I make my scirpt to check if thats the input and return and error if its something else until the user types in A or B. Its a bash script btw
    many thanks
    Last edited by ppatryk; 11-22-2011 at 10:50 PM.

  2. #2
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    This sounds a lot like a homework question, which are not allowed on this forum, so I am going to close this thread.

    An until loop is basically a negated while loop, so you may want to look into those.
    DISTRO=Arch
    Registered Linux User #388732

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...