From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10814 invoked by alias); 17 May 2016 19:58:27 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21576 Received: (qmail 15251 invoked from network); 17 May 2016 19:58:26 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.1 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: zsh-users@zsh.org To: zsh-users@zsh.org From: Emanuel Berg Subject: Re: sudo user-command-1; also-sudoed-command-2 Date: Tue, 17 May 2016 21:58:17 +0200 Message-ID: <86shxge9t2.fsf@student.uu.se> References: <86inydgbp6.fsf@student.uu.se> <45531463499099@web19m.yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-9ce1e655.08-680-7570702.cust.bredbandsbolaget.se Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:jhWHltuCaFHwc9SHSXfMAmVl0JE= "Nikolay Aleksandrovich Pavlov (ZyX)" 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 -