I know eshell
supports output redirection to buffers
cmd > #<buffername>
Is there a way to do piping buffer contents into command? I would like to have something like
cat #<buffername> | cmd
The problem is that cat
is not a builtin so it doesn't know emacs
buffers.
I could always save the buffer buffername
to a file and then cat
it but that is not always desired (e.g r-o filesystem)
In more detail
I am passing from using a terminal emulator with zsh towards using eshell. Often I write scripts that run a command, pipe the output into grep
,gawk
, sed
or whatnot and then pipe the result into another program.
I would like to separate this into steps. I know eshell
supports output redirection to buffer via
cmb > #<buffername>
I would then process the contents of buffername
using powerful emacs
tools.
I know then that eshell
does not support input redirection. I read in some manual to use pipes instead.
If I saved the output to a file with cmb > filename
I could then do
cat filename | cmd2
but sometimes saving a buffername
to a file filename
is impossible or inconvenient. Any tips?