From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26284 invoked by alias); 26 Sep 2013 23:38:48 -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: 18010 Received: (qmail 11276 invoked from network); 26 Sep 2013 23:38:44 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 74.125.82.172 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=MFWrp5gxvrAtu1cA7+quRRDnAl4D1pLjeg5brVZFEfQ=; b=hedKi0709X0n46OYjmaX/QFImuEiwEhc2hv14DANwDT/4BXhYZpdGC3F+zqVu2DXFy gsPuO/OJcsHfpEIwRihS9/hIvxs8B+4lwCYVPotn+O4+07sh4+UiADKG1cYu7FT0+vio FeK3oFGCLSWfyPv4nIrmIhQp/WwsqcVrzY0DmCX/AHsHPgOqQm/yIqy/km6hfSA2V1Jg HaiDbvVNx1aKESU674fHfUmOuWsgx8Sw55QCiPsEq2Ai49smJd26wYjjbkFYeE9Li4Fl E0+q5kJlqiHeXHQeNIGSSOjQr9Ik8YVTmbyzPZ2AAv1AiRDpjVGG4ANjygCJRDMZDDHb 5qWQ== X-Received: by 10.180.160.212 with SMTP id xm20mr2380875wib.23.1380227973293; Thu, 26 Sep 2013 13:39:33 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: =?UTF-8?B?SsOpcsOpbWllIFJvcXVldA==?= Date: Thu, 26 Sep 2013 22:39:18 +0200 Message-ID: Subject: Re: Any way to have ".sh" be optional? To: TJ Luoma Cc: Zsh-Users List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, 2013/9/26 TJ Luoma : > The Subject line may not be the best description of what I want, but > it was the best I could come up with. > > I tend to name all of my Zsh scripts to end with '.sh' so I can easily > `fgrep -i Whatever *.sh` when I'm looking for something. > > However, I would rather not have to type the ".sh" if not necessary. > (Yes, I am that lazy.) > > So assume I have a script "mkseries.sh" which I do not want to rename > but which I want to use in zsh just by typing "mkseries" -- is there a > way to tell zsh "If I use the command 'foo' and there is no 'foo' but > there is 'foo.sh' then I want to use 'foo.sh'? Something like command_not_found_handler() { test -x $1.sh && $1.sh $@[2,-1] } should do the trick. Best regards, --=20 J=C3=A9r=C3=A9mie