From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9971 invoked by alias); 13 Feb 2015 22:17:44 -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: 19870 Received: (qmail 8550 invoked from network); 13 Feb 2015 22:17:43 -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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Z4FijK0K1k223cDaHN6g0l1CoNgq387GFpbOUg/9B+4=; b=r3QlOjjUqjS0WlJJ2FcBJPiTWgQ+4a3JPNG5swX+kUBwleuzR3Vz+fzdW+og9GuvE5 xHpjD9o6yq4Eu+EuVkKLV6AhaeMv5Ny+dnuq/8ZLeR/PFofOWso2yGegh32Ai3qfXYzM +cn8pjAjLApSjOzK0gXaOTK5XU53R2iKHSLuvo6bbSX9j5NP9fTGXKIxfCbffd3+HtIN QripVBYDGLjJwoeV3eX5ft2Zz/gKd4JSaiquH45BYjda5c1YlvjBziqaN3ViPfaD2jJk 0uQWyuoiSgYM81oqQV64PkfDs7/DwMiw5HAWXS+bOspc5c1se8avtTRP+6NQBXNRYojS MqCg== MIME-Version: 1.0 X-Received: by 10.50.50.142 with SMTP id c14mr6699991igo.42.1423865862291; Fri, 13 Feb 2015 14:17:42 -0800 (PST) In-Reply-To: <20150213154138.118cf396@pwslap01u.europe.root.pri> References: <20150213154138.118cf396@pwslap01u.europe.root.pri> Date: Fri, 13 Feb 2015 23:17:42 +0100 Message-ID: Subject: Re: directory specific functions and aliases From: Mikael Magnusson To: Peter Stephenson Cc: Zsh Users Content-Type: text/plain; charset=UTF-8 On Fri, Feb 13, 2015 at 4:41 PM, Peter Stephenson wrote: > On Fri, 13 Feb 2015 10:05:21 -0500 > shawn wilson wrote: >> What would be the best way to make functions that do different things >> based on the directory I'm in - kinda like rvm does with rubies? I was >> hoping for something cleaner than: case $(pwd) This is mainly because >> I want to wrap cvs and rsync differently based on repo (and where >> within that repo). > > I use a dot-file in the directory, but you need to be careful with this > --- at least check you own the file before using it for extracting > commands or anything of that kind. I would check both the file and the containing directory; anyone can create hardlinks to files you own in their own directories, and a command that's safe in one directory may not be in another. -- Mikael Magnusson