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 21575
- From: Emanuel Berg <embe8573@xxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: sudo user-command-1; also-sudoed-command-2
- Date: Tue, 17 May 2016 21:51:06 +0200
- Cancel-lock: sha1:qEKTQpiOWaQ0rhRZ2UpNj8wLFU8=
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mail-copies-to: never
- Mail-followup-to: zsh-users@xxxxxxx
- 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>
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"
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