From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Is it possible to run shell script src blocks as root or to export individual blocks? Date: Sat, 03 Mar 2012 03:55:12 -0500 Message-ID: <10627.1330764912@alphaville> References: Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([208.118.235.92]:58245) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3kkI-00014h-AF for emacs-orgmode@gnu.org; Sat, 03 Mar 2012 03:55:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S3kkF-0003bA-FM for emacs-orgmode@gnu.org; Sat, 03 Mar 2012 03:55:17 -0500 Received: from g6t0187.atlanta.hp.com ([15.193.32.64]:1351) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S3kkF-0003aq-BY for emacs-orgmode@gnu.org; Sat, 03 Mar 2012 03:55:15 -0500 In-Reply-To: Message from Leo Alekseyev of "Fri, 02 Mar 2012 23:40:57 EST." List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Leo Alekseyev Cc: nicholas.dokos@hp.com, Emacs orgmode Leo Alekseyev wrote: > I was wondering if there was an easy way to execute some shell > commands contained in a src block as root. Alternatively, is there a > quick way to export _just_ that one source block to a temp file so > that I could run it as root manually? > You could set up sudo so that it does not require a password and prefix each command that needs to be run as root with "sudo": --8<---------------cut here---------------start------------->8--- * foo #+BEGIN_SRC sh sudo id #+END_SRC #+RESULTS: : uid=0(root) gid=0(root) groups=0(root) --8<---------------cut here---------------end--------------->8--- Not sure how sudo would interact with babel if you had to type in a password. Nick