Skip to content

Instantly share code, notes, and snippets.

@0xlkda
Last active January 6, 2023 10:53
Show Gist options
  • Save 0xlkda/287359453691ae94a9f5e96ffb244394 to your computer and use it in GitHub Desktop.
Save 0xlkda/287359453691ae94a9f5e96ffb244394 to your computer and use it in GitHub Desktop.
#!/bin/bash
# process 1:
$ mkdir /tmp/anything # create entry
$ exec 42> /tmp/anything/42 # open write on 42
$ echo "message here" >&42 # write message to 42
$ exec 42>&- # close write 42
# process 2:
$ exec 42< /tmp/anything/42 # open read on 42
$ cat <&42 # read from 42 and pipe to cat
$ message here
$ exec 42<&- # close read 42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment