OILS / spec / testdata / ysh-for-stdin.ysh View on Github | oilshell.org

37 lines, 21 significant
1
2# I think <> is just stdin for now
3# Later we could add
4#
5# < >
6# < *.py README.md >
7# etc.
8
9seq 3 | for x in <> {
10 echo "-$x-"
11}
12echo
13
14
15seq 3 | for i, x in <> {
16 echo "$i $x"
17}
18echo
19
20echo 'empty'
21
22fopen < /dev/null {
23 for x in <> {
24 echo "$x"
25 }
26}
27
28echo 'done'
29echo
30
31echo 'empty2'
32
33for x in <> {
34 echo "$x"
35} < /dev/null
36
37echo 'done2'