Closed dspinellis closed 7 years ago
The hang was due to the treatment of printf
as a builtin.
That said the graph dgsh -c 'echo hi | {{ cat & printf there & }} | cat'
is awkward because echo
cannot provide multiple outputs.
dgsh -c '{{ echo hi & printf there & }} | cat'
would be more appropriate.
However, the output is only hi if printf
does not use a newline.
The following works normally:
dgsh -c '{{ echo hi & printf "there\n" & }} | cat'
Calling printf now works correctly even without a newline. Perhaps you didn't notice thethere before the prompt? (It would have been a serious problem if we treated newlines specially at this level.)
$ dgsh -c '{{ echo hi & printf there & }} | cat'
hi
there$
A few more things remain to close this.
dgsh -c 'echo hi | {{ cat & cat & }} | cat'
) should error, not hang.The graph dgsh -c 'echo hi | {{ cat & printf there & }} | cat'
is totally legitimate and the handling is the expected; the command runs and terminates normally.
Don't mind me, it was late last night :-)
The graph dgsh -c 'echo hi | {{ cat & cat & }} | cat'
is not allowed at the moment because of the presence of two flexible commands in a multiple block (we will revisit this in issue #4 -- multipipe blocks). The graph now exits with an error, it does not hang.
Rephrased 1/3 and checked it.
The following command works fine.
The following command hangs.