Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Aug 8th, 2013  |  syntax: None  |  size: 0.63 KB  |  views: 27  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/bash
  2.  
  3. for i in {1..$1}
  4. do
  5.     echo $i
  6. done
  7.        
  8. 1
  9. 2
  10.        
  11. for ((i = 1; i <= $1; i++)); do
  12.     echo $i
  13. done
  14.  
  15. # Not recommended with large sequences.
  16. for i in $(seq 1 $1); do
  17.     echo $i
  18. done
  19.        
  20. #cycle through all args
  21. for (( i=1; i<=$#; i++ )); do
  22.     eval arg=$$i
  23.     echo "$arg"
  24. done
  25.        
  26. #cycle through all args
  27. for (( i=1; i<=$#; i++ )); do
  28.     echo "${!i}"
  29. done
  30.        
  31. seq $1
  32.        
  33. x=10; for i in $(eval echo {1..$x}); do echo $i; done
  34.        
  35. set -- 10
  36. for i in $(eval echo {1..$1})
  37. do
  38.     echo $i
  39. done
  40.        
  41. set -- 1000
  42. eval echo {1..$1} |
  43. while read i
  44. do
  45.     echo $i
  46. done
  47.        
  48. set -- 1000
  49. while read i
  50. do
  51.      echo $i
  52. done <(eval echo {1..$1})