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 21578
- 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 23:04:34 +0300
- Authentication-results: mxback10o.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=1463515474; bh=Rf2MuE22yy1KsYAyQNrkSLsCKo4m2suJuFxcFqI0ya0=; 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=WOxSjjfBB3M3asZHYBuprXOjmv061I6+PwhUXhY+BgY9v5xuK0cE0mD4KosSiRaBm G1irwGtkHfyb6AnQLNDIck7wMdFjZgSFV6Ghx2lk1mmokUFpjPEMtHbSp2qZ8ZN+Yu RJB/7uhx5MeYhs8OQ7RE9g8O3FvJTEb2Z8IgcqT8=
- In-reply-to: <86shxge9t2.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> <45531463499099@web19m.yandex.ru> <86shxge9t2.fsf@student.uu.se>
17.05.2016, 22:59, "Emanuel Berg" <embe8573@xxxxxxxxxxxxx>:
> "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
Where is `ll` alias defined?
>
>> (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
That was <blockquote>```zsh{newline}zudo-f () {{newline} emulate -L zsh{newline} sudo ZDOTDIR="${ZDOTDIR:-$HOME}" zsh -ic "$1"{newline}}</blockquote>. I do not know who spoiled the message, but I receive all my messages back from mailing list and it was fine, so it is something between you and mailing list.
>
> --
> 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