From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 165 invoked from network); 2 Jun 2003 06:37:25 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 2 Jun 2003 06:37:25 -0000 Received: (qmail 14743 invoked by alias); 2 Jun 2003 06:37:14 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6143 Received: (qmail 14736 invoked from network); 2 Jun 2003 06:37:14 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 2 Jun 2003 06:37:14 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [192.54.253.222] by sunsite.dk (MessageWall 1.0.8) with SMTP; 2 Jun 2003 6:37:13 -0000 Received: by binome.blorf.net (Postfix, from userid 1000) id 162EE32DB; Sun, 1 Jun 2003 23:36:50 -0700 (PDT) Date: Sun, 1 Jun 2003 23:36:50 -0700 From: Wayne Davison To: Eric Mangold Cc: zsh-users@sunsite.dk Subject: Re: using command aliases with sudo Message-ID: <20030602063650.GA13274@binome.blorf.net> References: <200305280204.44215.teratorn@world-net.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200305280204.44215.teratorn@world-net.net> User-Agent: Mutt/1.4.1i On Wed, May 28, 2003 at 02:04:44AM -0500, Eric Mangold wrote: > I'm thinking of writing an extension to zsh that makes aliases work with sudo. You just need an alias with a trailing space, like this: alias sudo='command sudo ' That will cause zsh to expand your command aliases after a "sudo" command. Unfortunately, it's not perfect because it does not handle sudo options properly. I.e., this won't work (where "agi" is your aliased command): sudo -u bin agi but this will work: sudo agi You can work around the problem for often-used users like this: alias sudobin='command sudo -u bin ' ..wayne..