make prettyping work with any posix-compatible shell#45
Open
xwang1498 wants to merge 2 commits intodenilsonsa:masterfrom
Open
make prettyping work with any posix-compatible shell#45xwang1498 wants to merge 2 commits intodenilsonsa:masterfrom
xwang1498 wants to merge 2 commits intodenilsonsa:masterfrom
Conversation
This change ignores SIGINT only for the pipeline elements downstream of ping. This way ping will correctly receive the SIGINT, print its summary and cleanly exit, and then downstream elements will cleanly close afterwards.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Because most of the heavy lifting is done in awk, we actually don't need any bash-specific features to run prettyping. Making prettyping work on any posix-compatible shell will extend this great program's reach even further!
This PR builds on the work done in PR #44 , and therefore supersedes and closes #44 and closes #40.
Tested on various shells, including:
Tested on various operating systems, including:
Implementation notes, which may be interesting while reviewing this PR:
$@. This way, they'll circle around to the front. For simplicity, parse them globally rather than inside of parse_arguments function (which would have its own$@).readwith the SIGWINCH, others do not. So we need to restartreadif it was interrupted by SIGWINCH, but not if the input is finished. I added a SIGWINCH test case to mockping.sh.