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: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