|
|
|
|
|
by goombacloud
1627 days ago
|
|
One more fun experiment: avoid the tempfile on disk/tmpfs by storing data into the pipe connecting two processes, where the first one can already exit for the pipe to give EOF when reading beyond the buffered data. true | sleep infinity &
STDINPID="$!"
TMPPIPE="/proc/$STDINPID/fd/0"
echo hello > "$TMPPIPE"
echo write more > "$TMPPIPE"
cat "$TMPPIPE"
echo write again > "$TMPPIPE"
cat "$TMPPIPE"
kill -9 "$STDINPID" # clean up pipe
Now I would like to avoid the additional process by using the current shell process instead. |
|