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 21576
- 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:58:17 +0200
- Cancel-lock: sha1:jhWHltuCaFHwc9SHSXfMAmVl0JE=
- 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> <45531463499099@web19m.yandex.ru>
"Nikolay Aleksandrovich Pavlov (ZyX)"
<kp-pav@xxxxxxxxx> writes:
> Why should it read zshrc without -i? If I am
> not mistaking using `sudo zsh -ic "…"` should
> be enough (assuming sudo keeps both $HOME and
> $ZDOTDIR, I do not remember this).
My neither, but anyway it doesn't work, at
least not here:
$ sudo zsh -ic 'll /'
gets:
zsh:1: command not found: ll
> (changed `$=` to `$(z)`). This will not run
> cycles though.
OK, done.
> You may change zudo-f to
>
> ```zsh zudo-f () { emulate -L zsh sudo
> ZDOTDIR="${ZDOTDIR:-$HOME}" zsh -ic "$1" } ```
>
> , but this has different downside: if alias or
> function was defined in user configuration
> everything may be fine. But if it was defined
> in the interactive session, it will not be
> used. Also this is going to be slower then
> your variant.
None of that is a problem to me, so let's see -
like this?
zzzudo () {
emulate -L zsh sudo ZDOTDIR="${ZDOTDIR:-$HOME}" zsh -ic "$1"
}
If so, no:
zzzudo:emulate:1: unknown argument sudo
--
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