From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29567 invoked from network); 20 May 2005 12:18:58 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 20 May 2005 12:18:58 -0000 Received: (qmail 73737 invoked from network); 20 May 2005 12:18:52 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 20 May 2005 12:18:52 -0000 Received: (qmail 12712 invoked by alias); 20 May 2005 12:18:44 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8873 Received: (qmail 12684 invoked from network); 20 May 2005 12:18:42 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 20 May 2005 12:18:42 -0000 Received: (qmail 72672 invoked from network); 20 May 2005 12:18:42 -0000 Received: from dep.let.rug.nl (129.125.8.60) by a.mx.sunsite.dk with SMTP; 20 May 2005 12:18:38 -0000 Received: from dep.let.rug.nl ([129.125.8.60]) by dep.let.rug.nl (SMSSMTP 4.1.0.19) with SMTP id M2005052014164227833 for ; Fri, 20 May 2005 14:16:42 +0200 Received: from loki (postfix@loki.let.rug.nl [129.125.8.86]) by dep.let.rug.nl (8.12.10/8.12.10) with ESMTP id j4KCGfVk003635 for ; Fri, 20 May 2005 14:16:41 +0200 (MEST) Received: by loki (Postfix, from userid 7006) id D067FE8E5; Fri, 20 May 2005 14:18:37 +0200 (CEST) Date: Fri, 20 May 2005 14:18:35 +0200 From: Francisco Borges To: Zsh User Subject: retrieving the results of last command? Message-ID: <20050520121834.GA32499@let.rug.nl> Mail-Followup-To: Zsh User Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: Linux/2.6.8-1-686 (i686) X-Editor: GNU Emacs 22.0.50.1 Organization: Alfa Informatica - Rijksuniversiteit Groningen User-Agent: Mutt/1.5.6+20040907i X-Whitelist: OK X-Scanned-By: milter-spamc/0.25.321 (dep.let.rug.nl [129.125.8.60]); Fri, 20 May 2005 14:16:42 +0200 X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 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