Enter a number to pause, and then print from 1 to that number, and then ask if you want to continue. Then enter the number and print it again, without continuing to exit

Source: Internet
Author: User

#!/bin/bash while:; Do Read-p "does continue (y/n):" K case $k in Y) read-p "U-Input the number:" N if [$n-lt 6] then m= ' seq $n  5 ' echo $m elif [$n-gt 5] && [$n-lt] then m1= ' seq $n ' echo $m 1 fi continue;  n) exit;  *) echo "You entered the error, please re-enter";; Esacdonefi
#!/bin/bashkl () {read-p "input a pause num:" iread-p "input a pause num:" Xi for ((i= $i; i<= $xi; i++))-do EC Ho-e "$i \c" done echo}while:d o read-p "continue? (y|n) "Yes if [" $yes "=" y "] then kl else exit 1 Fidone


This article is from the "Steven Never give Up" blog, please be sure to keep this source http://wsw26.blog.51cto.com/1442148/1755272

Enter a number to pause, and then print from 1 to that number, and then ask if you want to continue. Then enter the number and print it again, without continuing to exit

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.