From owner-freebsd-questions@FreeBSD.ORG Sun Oct 26 01:36:34 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E2501065672 for ; Sun, 26 Oct 2008 01:36:34 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (agora.rdrop.com [199.26.172.34]) by mx1.freebsd.org (Postfix) with ESMTP id 1F1A58FC1C for ; Sun, 26 Oct 2008 01:36:34 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id m9Q1aXlZ067891 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 25 Oct 2008 18:36:33 -0700 (PDT) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.12.9/Submit) with UUCP id m9Q1aXEx067890; Sat, 25 Oct 2008 18:36:33 -0700 (PDT) Received: from fbsd61 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA06366; Sat, 25 Oct 08 18:32:36 PDT Date: Sat, 25 Oct 2008 18:37:36 -0700 From: perryh@pluto.rain.com To: kelly.terry.jones@gmail.com Message-Id: <4903c9e0.kerD5YQu0ikZMn3r%perryh@pluto.rain.com> References: <26face530810251811i3757db68wb7ed44faaf51444b@mail.gmail.com> In-Reply-To: <26face530810251811i3757db68wb7ed44faaf51444b@mail.gmail.com> User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: sudo multiple commands at once without shell script X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2008 01:36:34 -0000 > How do I run multiple sudo commands at once? This fails > because the semicolon ends the whole sudo command: > > > sudo whoami; whoami > root > user > > This confuses tcsh: > > monica:~> sudo ( whoami ; whoami ) > Badly placed ()'s. Supposing sudo spawns a shell, something like ~> sudo whoami \; whoami or ~> sudo "whoami; whoami" should work. If not, maybe try explicitly running a shell: ~> sudo sh -c "whoami; whoami"