From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14639 invoked by alias); 17 May 2016 20:05:49 -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: 21577 Received: (qmail 9033 invoked from network); 17 May 2016 20:05:48 -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,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1463514892; bh=4eSsQXe8fI58NIQfJVJgQ33MQOiaHTFHELLU3MSbSnE=; 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=uhVFxOKhHl/KxxnTmIC3INeKzUD0qwbWhOBXPCMVHadY7eXP6a71aMdx2cYM6pCen O5Xt75oSSFKUoGZSqnT109hqmOiYCqQlnfeCh9SLm91vnPau87ERRrVszyqeQA29LH VLDOdCzGOTpEtASWoiVvq0nuX0Ah975jUm5MWPoE= Authentication-Results: mxback3o.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-ForeignMX: SE X-Yandex-Suid-Status: 1 0,1 0,1 20735984 X-Yandex-Sender-Uid: 9151298 From: "Nikolay Aleksandrovich Pavlov (ZyX)" To: Emanuel Berg , "zsh-users@zsh.org" In-Reply-To: <86wpmsea51.fsf@student.uu.se> References: <86inydgbp6.fsf@student.uu.se> <86wpmsea51.fsf@student.uu.se> Subject: Re: sudo user-command-1; also-sudoed-command-2 MIME-Version: 1.0 Message-Id: <1077001463514892@web6o.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Tue, 17 May 2016 22:54:52 +0300 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=koi8-r 17.05.2016, 22:52, "Emanuel Berg" : > Bart Schaefer > 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 -