Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: sudo user-command-1; also-sudoed-command-2



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