Created
April 14, 2023 11:34
-
-
Save WesselAtWork/8b8367d55f720d1a434989d65ece9f62 to your computer and use it in GitHub Desktop.
Something I figured out to do `for every X bytes process stream`
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
| printf '12345678910' | ( #example data (subshell might or might not be nessaray) | |
| count=0; #init count to zero | |
| while true; #loop forever | |
| do { | |
| ((count++)); #increment count | |
| head -c 2 < /dev/stdin | #take from sdin until... | |
| ifne -n false > "test$count.txt" || exit; #...there is nothing left then exit | |
| } done; | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment