zsh-users
 help / color / mirror / code / Atom feed
From: Wayne Davison <wayned@users.sourceforge.net>
To: Eric Mangold <teratorn@world-net.net>
Cc: zsh-users@sunsite.dk
Subject: Re: using command aliases with sudo
Date: Sun, 1 Jun 2003 23:36:50 -0700	[thread overview]
Message-ID: <20030602063650.GA13274@binome.blorf.net> (raw)
In-Reply-To: <200305280204.44215.teratorn@world-net.net>

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..


      parent reply	other threads:[~2003-06-02  6:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-28  7:04 Eric Mangold
2003-06-02  5:54 ` Borzenkov Andrey
2003-06-02  6:24   ` Danek Duvall
2003-06-02  6:35     ` Borzenkov Andrey
2003-06-02  6:23 ` Stephen Rueger
2003-06-02  6:36 ` Wayne Davison [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030602063650.GA13274@binome.blorf.net \
    --to=wayned@users.sourceforge.net \
    --cc=teratorn@world-net.net \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).