Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • Though this doesn't check if the number line gets read correctly Commented Jun 5, 2017 at 13:35
  • @ilkkachu read number || break perhaps. With an extra echo -n "Enter your name: " at the end of the loop. Better still, incorporate the prompt in the read itself, while read -p "Enter your name: " name && read -p "Enter your number: " number; do ... done Commented Jun 5, 2017 at 13:37
  • @Shaller, I have applied your concept in following script. But not working :(. paste.fedoraproject.org/paste/… Commented Jun 5, 2017 at 13:50
  • that looks like completely different input than your original question Commented Jun 5, 2017 at 13:58
  • @Jeff I have applied Rakesh answer. It's working fine. Thanks a lot. Commented Jun 5, 2017 at 14:02