diff --git a/examples/advanced/cpu-model.ion b/examples/advanced/cpu-model.ion index 37264def6530ad1c99942e571120f89b5f2f4d0c..a89795eef1c7ac8871ea91e58f5604d556f69421 100644 --- a/examples/advanced/cpu-model.ion +++ b/examples/advanced/cpu-model.ion @@ -2,4 +2,4 @@ # Prints the model name of the CPU -echo @[grep 'model name' /proc/cpuinfo | head -1][3..5] +echo @(grep 'model name' /proc/cpuinfo | head -1)[3..5] diff --git a/examples/braces.ion b/examples/braces.ion index fbfed7a833794da9e7db079207697b5c9cc82764..8bc78fecc6e9573a24a538fd5fd7c5bd3b782827 100644 --- a/examples/braces.ion +++ b/examples/braces.ion @@ -1,4 +1,9 @@ +# nested braces echo 1{A{1,2},B{1,2}} + +# permutating braces +echo {0,1}abc{2,3,4}def{5,6,7}{g,h,i} + # inclusive ranges echo {-1...1} echo {2...0} @@ -6,6 +11,7 @@ echo {a...c} echo {d...b} echo {A...C} echo {D...B} + # exclusive ranges echo {-1..2} echo {2..-1} @@ -13,6 +19,7 @@ echo {a..d} echo {d..a} echo {A..D} echo {D..A} + # inclusive stepped ranges echo {0..2...4} echo {a..2...e} @@ -20,6 +27,7 @@ echo {A..2...E} echo {0..-2...-4} echo {e..-2...a} echo {E..-2...A} + # exclusive stepped ranges echo {0..2..5} echo {a..2..f} diff --git a/examples/braces.out b/examples/braces.out index 02df6b2b092e2288fce9e16b328249aab962ab46..e27ebdbfd9c9b302ae65259b2d23d5999f3e3c7c 100644 --- a/examples/braces.out +++ b/examples/braces.out @@ -1,4 +1,5 @@ 1A1 1A2 1B1 1B2 +0abc2def5g 0abc2def5h 0abc2def5i 0abc2def6g 0abc2def6h 0abc2def6i 0abc2def7g 0abc2def7h 0abc2def7i 0abc3def5g 0abc3def5h 0abc3def5i 0abc3def6g 0abc3def6h 0abc3def6i 0abc3def7g 0abc3def7h 0abc3def7i 0abc4def5g 0abc4def5h 0abc4def5i 0abc4def6g 0abc4def6h 0abc4def6i 0abc4def7g 0abc4def7h 0abc4def7i 1abc2def5g 1abc2def5h 1abc2def5i 1abc2def6g 1abc2def6h 1abc2def6i 1abc2def7g 1abc2def7h 1abc2def7i 1abc3def5g 1abc3def5h 1abc3def5i 1abc3def6g 1abc3def6h 1abc3def6i 1abc3def7g 1abc3def7h 1abc3def7i 1abc4def5g 1abc4def5h 1abc4def5i 1abc4def6g 1abc4def6h 1abc4def6i 1abc4def7g 1abc4def7h 1abc4def7i -1 0 1 2 1 0 a b c diff --git a/examples/builtin_piping.ion b/examples/builtin_piping.ion index 30a70e9134069b6728fdd7af0aef2c52e921ba7e..8962861ba7e0fe524ca7d708b1b21ddd6d96d142 100644 --- a/examples/builtin_piping.ion +++ b/examples/builtin_piping.ion @@ -1,4 +1,5 @@ matches Foo '([A-Z])\w+' && echo true matches foo '([A-Z])\w+' || echo false +echo foo | cat read foo <<< $(echo bar) echo $foo diff --git a/examples/builtin_piping.out b/examples/builtin_piping.out index cd0c5dc59ef387749bd71e7085a400b086626ca8..abd1f96563cefdf207a13be020ea4d2f0e9a159d 100644 --- a/examples/builtin_piping.out +++ b/examples/builtin_piping.out @@ -1,3 +1,4 @@ true false +foo bar diff --git a/examples/continue.ion b/examples/continue.ion new file mode 100644 index 0000000000000000000000000000000000000000..c879922c73e58d80453c019e31f4de33fe6014cc --- /dev/null +++ b/examples/continue.ion @@ -0,0 +1,6 @@ +for value in 1...10 + if test 0 -eq $(( value % 2 )) + continue + end + echo $value +end \ No newline at end of file diff --git a/examples/continue.out b/examples/continue.out new file mode 100644 index 0000000000000000000000000000000000000000..2738e8e70a4ea4fdcb1cfac5a38607e605959c74 --- /dev/null +++ b/examples/continue.out @@ -0,0 +1,5 @@ +1 +3 +5 +7 +9