From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7959 invoked by alias); 26 Sep 2013 21:40:24 -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: 18006 Received: (qmail 642 invoked from network); 26 Sep 2013 21:40:20 -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.6 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at brasslantern.com does not designate permitted sender hosts) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=1YgODz7OVx0ZQGm2im6gpcYRm+jqVoIAnSAMEEKU43Q=; b=aez3jExpGTZ/RAUAFHYsOdCwTKI+UZcYOOuuVORnmUrrecQbwK28Bwe9SzQEBt5V2O yPdFA5yCqpqFYmP/x27BqjKTQCPPDZIVAPwx246Bv7PweMPmz/vdeOAZnjdEUYHOfDQ5 Wnaq91rlM3J8T3PC0RjgH/YEwpBSp5jROBmuIRzcclFlWngkzHza4KlMjTm1RSr/+ZJq KhCtH6gBeYGfnYpWhzRpWc83buZUH1A9B2FrhFcj2e0caz9pdhRV5+gOWoDcdFsn9J7R WLWh8687d0tYLXpFk7bgQ8ktCtqXrBRBNOmWYFE3oeVJrQFpwhNOh39o1Okzdg4Zkids HmXg== X-Gm-Message-State: ALoCoQkJoCQ2kjh8Bv9j0Qpq0pSFGbrQ/mpxTTcFo5zZXwBcD9MwFuWlvBLOAoYF2jxfo0W9xLeu MIME-Version: 1.0 X-Received: by 10.112.156.166 with SMTP id wf6mr5529904lbb.13.1380231613497; Thu, 26 Sep 2013 14:40:13 -0700 (PDT) In-Reply-To: References: Date: Thu, 26 Sep 2013 14:40:13 -0700 Message-ID: Subject: Re: Any way to have ".sh" be optional? From: Bart Schaefer To: Zsh-Users List Content-Type: multipart/alternative; boundary=001a11c18e7a07cf4e04e750374b --001a11c18e7a07cf4e04e750374b Content-Type: text/plain; charset=ISO-8859-1 On Thu, Sep 26, 2013 at 1:12 PM, TJ Luoma wrote: > 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'? > command_not_found_handler() { local cmd=$1 shift # apply whatever tests you want to figure out if $cmd.sh exists, return 1 if not # if it does exist, then $cmd.sh "$@" } --001a11c18e7a07cf4e04e750374b--