for.ion 553 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. for i in 1..6
  2. echo $i
  3. end
  4. for i in 1...5
  5. echo $i
  6. end
  7. for i in 1 2 3 4 5
  8. echo $i
  9. end
  10. for i in @(echo 1 2 3 4 5)
  11. echo $i
  12. end
  13. for i in [1 2 3 4 5]
  14. echo $i
  15. end
  16. for i in 1{A{1,2},B{1,2}}
  17. echo $i
  18. end
  19. for x y z in 1..=10
  20. echo $x, $y, $z
  21. end
  22. let array = [ 1 2 3 4 5 ]
  23. for i in @array
  24. echo $i
  25. end
  26. let multi_line_input = "one
  27. two
  28. three"
  29. for word in $multi_line_input
  30. echo "; $word"
  31. end
  32. mkdir for_test
  33. cd for_test
  34. touch "a b c"
  35. touch "d e f"
  36. touch "g"
  37. touch "h i"
  38. for file in *
  39. echo $file
  40. end
  41. cd ..
  42. rm for_test -R