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 21577
- From: "Nikolay Aleksandrovich Pavlov (ZyX)" <kp-pav@xxxxxxxxx>
- To: Emanuel Berg <embe8573@xxxxxxxxxxxxx>, "zsh-users@xxxxxxx" <zsh-users@xxxxxxx>
- Subject: Re: sudo user-command-1; also-sudoed-command-2
- Date: Tue, 17 May 2016 22:54:52 +0300
- Authentication-results: mxback3o.mail.yandex.net; dkim=pass header.i=@yandex.ru
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1463514892; bh=4eSsQXe8fI58NIQfJVJgQ33MQOiaHTFHELLU3MSbSnE=; h=X-Yandex-Sender-Uid:X-Yandex-Hint:X-Yandex-Hint:From:To: In-Reply-To:References:Subject:MIME-Version:Message-Id:X-Mailer: Date:Content-Transfer-Encoding:Content-Type; b=uhVFxOKhHl/KxxnTmIC3INeKzUD0qwbWhOBXPCMVHadY7eXP6a71aMdx2cYM6pCen O5Xt75oSSFKUoGZSqnT109hqmOiYCqQlnfeCh9SLm91vnPau87ERRrVszyqeQA29LH VLDOdCzGOTpEtASWoiVvq0nuX0Ah975jUm5MWPoE=
- In-reply-to: <86wpmsea51.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> <CAH+w=7apZPY41mR_=pdZ134aUUT8jaCuKnP_vScVAiER-Pc9Cg@mail.gmail.com> <86wpmsea51.fsf@student.uu.se>
17.05.2016, 22:52, "Emanuel Berg" <embe8573@xxxxxxxxxxxxx>:
> Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
> writes:
>
>>> 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
>> "...."
>>
>> ??
>
> You mean:
>
> zzudo () { sudo ZDOTDIR="${ZDOTDIR:-$HOME}" zsh -c $1}
>
> and then provide a string as input, e.g.
>
> $ zzudo ll /
>
> ?
>
> I don't get that to work with 'll', the user
> ls alias: "command not found: ll"
Check my reply, @Bart Schaefer missed `-i`, without this .zshrc is not read.
>
> I don't have ZDOTDIR set by the way.
>
> --
> underground experts united .... http://user.it.uu.se/~embe8573
> Emacs Gnus Blogomatic ......... http://user.it.uu.se/~embe8573/blogomatic
> - so far: 32 Blogomatic articles -
Messages sorted by:
Reverse Date,
Date,
Thread,
Author