3 ms·
For that, to start with, you'd need to be able to create a feedback loop of awk's output back to itself as input. For it not to interfere with rendering, it nee
by mths 4y ago
For that, to start with, you'd need to be able to create a feedback loop of awk's output back to itself as input. For it not to interfere with rendering, it needs to be on a separate file descriptor from stdout.
I found this snippet on stackexchange showing how exactly that is possible on Linux.
> echo hello | gawk '!length{exit(0)} {print; print substr($0,2) >"/dev/fd/3"; fflush()}' 3>/dev/fd/0
This "renders" on stdout then feeds itself more input on /dev/fd/3.
- ufo 4y agoWow