Skip to content

Instantly share code, notes, and snippets.

@hellwolf
Last active January 6, 2023 13:17
Show Gist options
  • Save hellwolf/434bdb79db1b5cccb07f310d921852ba to your computer and use it in GitHub Desktop.
Save hellwolf/434bdb79db1b5cccb07f310d921852ba to your computer and use it in GitHub Desktop.
Recursive unix pipes, bash functional?
$ f () { if [ $1 -gt 0 ];then less | f $(( $1 - 1 ));else less;fi; }
$ cat /dev/random | xxd | f 100
$ ps aux| grep less | wc -l
102
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment