Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # the open is done right away, reading however, is done only after a
- # connection is established to the unix domain socket. This keeps the file
- # around, and also "waits" for the last write from the producer process to
- # happen. (Tested with socat version 1.7.3.2(-1 debian testing)
- socat open:/proc/$PID/fd/$FD unix-listen:/tmp/$PID.$FD.sock &
- # Wait until the producer process exits, then "retrieve" the file.
- socat unix-connect:/tmp/$PID.$FD.sock -> /tmp/the-file # -> it is!
Add Comment
Please, Sign In to add comment