bash: any way to reuse the last output?

Herculano de Lima Einloft Neto hlen at ig.com.br
Sat Jan 24 00:39:46 UTC 2004


Here's an interesting hack. It won't do after all, since it breaks
things like colors and columns in ls output, man page scrolling.. and
appends an ugly thing to all the lines in your history, with time. :)
But it's worth noting, since it illustrates useful resources:
(could it be fixed?)

.inputrc:
"^[k": accept-line
"^M": " | tee /tmp/h_lastcmd.out ^[k"

.bash_profile:
export __=/tmp/h_lastcmd.out

If you try it, Alt-k will stand for the old Enter; use "command $__" to
access the last output.

Best,
--
Herculano de Lima Einloft Neto





More information about the fedora-list mailing list