From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19270 invoked by alias); 20 Apr 2011 12:52:38 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 15970 Received: (qmail 12694 invoked from network); 20 Apr 2011 12:52:25 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at mail.nih.gov designates 128.231.90.100 as permitted sender) X-IronPortListener: NIH_Relay X-SBRS: None X-IronPort-AV: E=Sophos;i="4.64,246,1301889600"; d="scan'208";a="37627684" X-Authentication-Warning: cosy.cit.nih.gov: arif set sender to Anthony R Fletcher using -f Date: Wed, 20 Apr 2011 08:41:29 -0400 From: Anthony R Fletcher To: Subject: Re: Suffix alias for README files Message-ID: <20110420124129.GB18289@cosy.cit.nih.gov> Mail-Followup-To: zsh-users@zsh.org References: <20110419135909.GA21897@cosy.cit.nih.gov> <1590CA5C-3329-4DF1-8E73-E7FE218A21D9@biskalar.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1590CA5C-3329-4DF1-8E73-E7FE218A21D9@biskalar.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (cake.cit.nih.gov [165.112.93.31]); Wed, 20 Apr 2011 08:41:29 -0400 (EDT) On 20 Apr 2011 at 11:23:07, Sebastian Stark wrote: > > Am 19.04.2011 um 15:59 schrieb Anthony R Fletcher: > > > I can use suffix aliases to display various .txt files. So > > > > alias -s txt=less > > ./x.txt > > > > actually runs > > > > less ./x.txt > > > > Can I do a similar thing for README files? So the "command" > > > > /some/path/README > > > > will really run the command > > > > less /some/path/README > > It doesn't really answer your question, but are you aware of nullcmd redirection? > > > or > > > will call whatever pager or viewer is set in $READNULLCMD. In the first case it's even less characters to type :) > > > Sebastian Thanks for the reply. Yes, I am aware of the nullcmd redirection and it doesn't quite fit with the way I wanted to be lazy. The use case is to have run something like find . -name README identify an interesting README file, triple click it with the mouse to copy it (with trailing newline) and paste it into the current shell. So I have to type "less " or "<" before I paste. The reality is I forget and then use the history to repeat the now pasted line and add the leading command. So I wondered if you could do "the right thing" with files like x.txt was there a way for README files? Anthony. -- Anthony R Fletcher Room 2033, Building 12A, http://dcb.cit.nih.gov/~arif National Institutes of Health, arif@mail.nih.gov 12A South Drive, Bethesda, Phone: (+1) 301 402 1741. MD 20892-5624, USA.