Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: sudo user-command-1; also-sudoed-command-2
- X-seq: zsh-users 21572
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: sudo user-command-1; also-sudoed-command-2
- Date: Tue, 17 May 2016 03:43:39 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to; bh=tLkKg3sjpvQHg0IZqjB1KT0Ezefz8N2dnoiY2AMikxU=; b=NEeYQEozoOlpJHRHgxHRq+Ac1NQF/uO9xHj+khtwtGmir+JVt9hEbb1Hzt0P1plAYg xMoVmS1p2Jy00+Ik+LTLOIB78KTDjJzjviqkpYNf2E4K21yfFPu7ftkL7ofzbAuAWyWB Ojf73FrEgEI7UOHmpt7q5urwbV2WvpeAPHa1qNrYxtR31ulv8CV9FArP3KdmkHSBM/qj MDkoaP3ZulF862Pb6xDl9Sm9E2vumkEM2Ibxo1SirOd2Yky+eAhGw/A1ig/XviKS4AXH qDJcaj3iy6N4F1VPmoE716NsLhPBkf/XGfWC+DEjh2N1BghcU+PIFpt4X20x2F+zB6gp DBVA==
- In-reply-to: <86inydgbp6.fsf@student.uu.se>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <86inydgbp6.fsf@student.uu.se>
On Mon, May 16, 2016 at 10:22 AM, Emanuel Berg <embe8573@xxxxxxxxxxxxx> wrote:
> How can I execute a block of arbitrary commands
> with sudo, but only having to type sudo once,
> and still be able to use the user functions?
Why not
sudo ZDOTDIR="${ZDOTDIR:-$HOME}" zsh -c "...."
?? That should cause zsh to read the current user's .zshrc etc. files
before executing the "...", thereby obtaining the alias and function
definitions.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author