make prettyping work with any posix-compatible shell #45
+152
−159
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.