grub_script_continue.in 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #! @builddir@/grub-shell-tester
  2. #
  3. # Copyright (C) 2010 Free Software Foundation, Inc.
  4. #
  5. # GRUB is free software: you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation, either version 3 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # GRUB is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  17. # continue without any arguments
  18. for i in 1 2 3 4 5 6 7 8 9 10
  19. do
  20. if test "$i" = 5
  21. then
  22. continue
  23. fi
  24. echo $i
  25. done
  26. # continue with one
  27. for i in 1 2 3 4 5 6 7 8 9 10
  28. do
  29. if test "$i" = 5
  30. then
  31. continue 1
  32. fi
  33. echo $i
  34. done
  35. # continue with loop count
  36. for i in 1 2 3 4 5
  37. do
  38. for j in a b c d e f
  39. do
  40. if test "$i" = 3
  41. then
  42. if test "$j" = d
  43. then
  44. continue 2
  45. fi
  46. echo "$i $j"
  47. fi
  48. done
  49. done
  50. # continue into middle loop
  51. for i in 1 2 3 4 5
  52. do
  53. for j in a b c d e f
  54. do
  55. if test "$i" = 3
  56. then
  57. if test "$j" = d
  58. then
  59. continue 1
  60. fi
  61. echo "$i $j"
  62. fi
  63. done
  64. done
  65. # while and until loops
  66. a=
  67. while test "$a" != "aaaaaaa"
  68. do
  69. a="a$a"
  70. for i in 1 2 3 4
  71. do
  72. b=
  73. until test "$b" = "bbbbb"
  74. do
  75. b="b$b"
  76. if test "$i" = 3; then echo "continue 2"; continue 2; fi
  77. echo "$a $i $b"
  78. done
  79. done
  80. done