Skip to content

Instantly share code, notes, and snippets.

@jwerle
Created April 23, 2014 23:48
Show Gist options
  • Save jwerle/11236508 to your computer and use it in GitHub Desktop.
Save jwerle/11236508 to your computer and use it in GitHub Desktop.
# redirect tcp to fifo
$ while true; do nc -l 6000 > fifo; done
# redirect fifo to cat and prefix with "> "
$ while true; do printf "> "; cat < fifo; done
>
# write to tcp
$ echo abc | nc localhost 6000
$ echo 123 | nc localhost 6000
# The fifo redirect to cat call will yield the following
> abc
> 123
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment