Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
retrieving the results of last command?
- X-seq: zsh-users 8873
- From: Francisco Borges <f.borges@xxxxxx>
- To: Zsh User <zsh-users@xxxxxxxxxx>
- Subject: retrieving the results of last command?
- Date: Fri, 20 May 2005 14:18:35 +0200
- Mail-followup-to: Zsh User <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: Alfa Informatica - Rijksuniversiteit Groningen
Often I'm in the situation of using say:
% locate a-file
/usr/share/prog/a-file
%
Then I want to use the pathname to copy the file. I Know of 3 somewhat
cumbersome ways to do this:
1. Copying and pasting with the mouse.
2. Using `locate a-file` (which is a bit more cumbersome to me than to
most because I swapped the keys to ` and ~).
3. Using $(comm).
Is there a "faster" way than `` to perform command expansion?
I tried to code a widget to do this, but I this is as far as I got:
insert-last-command-output(){
com="`fc -ln -1`"
RBUFFER=`$com`
}
zle -N insert-last-command-output
bindkey "^X^L" insert-last-command-output
#(^X^L was the first free key I could remember...)
but is fails with:
% locate ipython.el
/usr/bla/ipython.el
% insert-last-command-output:1: command not found: locate ipython.el
Any hints?
Cheers,
Francisco
Messages sorted by:
Reverse Date,
Date,
Thread,
Author