From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 275 invoked by alias); 17 May 2016 10:43:44 -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: 21572 Received: (qmail 4363 invoked from network); 17 May 2016 10:43:43 -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,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to; bh=tLkKg3sjpvQHg0IZqjB1KT0Ezefz8N2dnoiY2AMikxU=; b=NEeYQEozoOlpJHRHgxHRq+Ac1NQF/uO9xHj+khtwtGmir+JVt9hEbb1Hzt0P1plAYg xMoVmS1p2Jy00+Ik+LTLOIB78KTDjJzjviqkpYNf2E4K21yfFPu7ftkL7ofzbAuAWyWB Ojf73FrEgEI7UOHmpt7q5urwbV2WvpeAPHa1qNrYxtR31ulv8CV9FArP3KdmkHSBM/qj MDkoaP3ZulF862Pb6xDl9Sm9E2vumkEM2Ibxo1SirOd2Yky+eAhGw/A1ig/XviKS4AXH qDJcaj3iy6N4F1VPmoE716NsLhPBkf/XGfWC+DEjh2N1BghcU+PIFpt4X20x2F+zB6gp DBVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to; bh=tLkKg3sjpvQHg0IZqjB1KT0Ezefz8N2dnoiY2AMikxU=; b=Dr8+37JWLL6GO8zd2jrA+FPwrPMXekQ2uON3liFpZa84/o+Yak+5z5fUypnbjfcsLQ K4AWseahhy59CZ0E65KdUgrWfPvyU+Ah69/2lJA/VXWdQUWLNQVjRCmSAbhlHridSyLu AWPi0RZO7a+k+uiQYhyQL0OCDR03SndUV2C+J000PHJ4NKPQEL7k3XuHyry8iqBFm5zK zCdI5RHeUcRqAlCGKxYry3JFJk7hHAoxKeSwOmaKYIM/hfgYEgldqu+lEZn8ovm2FdVQ h1mzQ9WSD/9PE5eDATBulw8YgXLT1MYY6f+6rPhjq4HFOdUZG4ZHMehZZEpIvZgpywtk WQpw== X-Gm-Message-State: AOPr4FU8/RiRq7GQzoaXOk5/KTz/XY9YX0JmVKwDtm2myFABFXzqN6De0c75siLV4UlvIu/ZLAJdvDXERPR02g== MIME-Version: 1.0 X-Received: by 10.25.147.82 with SMTP id v79mr201732lfd.43.1463481819203; Tue, 17 May 2016 03:43:39 -0700 (PDT) In-Reply-To: <86inydgbp6.fsf@student.uu.se> References: <86inydgbp6.fsf@student.uu.se> Date: Tue, 17 May 2016 03:43:39 -0700 Message-ID: Subject: Re: sudo user-command-1; also-sudoed-command-2 From: Bart Schaefer To: Zsh Users Content-Type: text/plain; charset=UTF-8 On Mon, May 16, 2016 at 10:22 AM, Emanuel Berg wrote: > 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 "...." ?? That should cause zsh to read the current user's .zshrc etc. files before executing the "...", thereby obtaining the alias and function definitions.