Comments (4)
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'
from dgsh.
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$
from dgsh.
A few more things remain to close this.
- Statements (e.g.
dgsh -c 'echo hi | {{ cat & cat & }} | cat'
) should error, not hang. - We should also handle correctly other builtins that can cause trouble.
- Ideally, we should just auto-wrap builtins when needed, rather than remove them. This will make it easier to integrate dgsh functionality into the bash distribution.
from dgsh.
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.
from dgsh.
Related Issues (20)
- [RFE] Parallelize processes receiving different input streams HOT 8
- Timeout for negotiation when run interactively from dgsh HOT 10
- Bash raising 'no version information available' HOT 4
- error: 'dir_fd' may be used uninitialized in this function HOT 6
- Executable stack HOT 2
- Unable to Build on MacOs Mojave HOT 4
- How to background a process with dgsh HOT 1
- different example HOT 5
- rsync: getaddrinfo: translationproject.org 873: Temporary failure in name resolution HOT 2
- Named pipelines HOT 1
- Porting for 1) Natively on termux (Follows aarch64) 2)Ubuntu arm64 /(any other linux distro) running inside proot container on termux HOT 21
- can not compile - gnulib problem HOT 11
- Deadlock in dgsh-tee
- Avoid nout=0 on last pipe component HOT 6
- Optimize dgsh program detection
- Provide way to detect whether a script is running under dsgh? HOT 7
- Wrap rather than modify the source code of single-output commands HOT 1
- Document POSIX tools with dgsh capabilities
- Simple scripts failing with random "dgsh: timeout for negotiation" HOT 32
- Problem with grep (maybe) HOT 18
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dgsh.