cmd/gosh/testdata/script/flags.txtar
raw| 1 | # -c with a command does not read stdin |
| 2 | stdin stdin.sh |
| 3 | exec gosh -c 'echo from-c' |
| 4 | stdout 'from-c' |
| 5 | ! stdout 'from-stdin' |
| 6 | |
| 7 | # an empty -c is a no-op, like in other shells |
| 8 | stdin stdin.sh |
| 9 | exec gosh -c '' |
| 10 | ! stdout . |
| 11 | |
| 12 | # without -c, stdin is run |
| 13 | stdin stdin.sh |
| 14 | exec gosh |
| 15 | stdout 'from-stdin' |
| 16 | |
| 17 | -- stdin.sh -- |
| 18 | echo from-stdin |