Piping Shell Output to an
2. September 2020
Every few months, I see someone on
#emacs mention new
functionality, or re-read amebevar’s excellent post on using it as their main
and am inspired to give it another try. I dream of replacing
long pipelines of
awk invocations with simple
experiencing the best parts of Plan9’s UX, seamlessly redirecting output to
buffers, and being freed from the tyranny of
by the wonderful
Sadly, as a dyed-in-the-wool
bash user who’s committed more scripting
knowledge to memory than is healthy, I always come back to
fail, the feature I miss most from my dalliances with
eshell is piping command
output into a buffer. With this alias, you can have the best of both worlds.
1 alias eless='(f=$(mktemp "/tmp/pipe.XXX"); cat > $f; emacsclient $f; rm -v $f)'
Invoke it by simply piping to it:
cat some-big-file.txt | eless. When you kill
the buffer with
C-x # your
emacsclient session will end, returning you to your
shell buffer, and the temp file created will be deleted.