Skip to content

Instantly share code, notes, and snippets.

@WesselAtWork
Created April 14, 2023 11:34
Show Gist options
  • Select an option

  • Save WesselAtWork/8b8367d55f720d1a434989d65ece9f62 to your computer and use it in GitHub Desktop.

Select an option

Save WesselAtWork/8b8367d55f720d1a434989d65ece9f62 to your computer and use it in GitHub Desktop.
Something I figured out to do `for every X bytes process stream`
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