From owner-freebsd-questions@FreeBSD.ORG Wed Dec 3 08:50:30 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 7C82C106564A for ; Wed, 3 Dec 2008 08:50:30 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id E743C8FC1B for ; Wed, 3 Dec 2008 08:50:29 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (adsl37-141.kln.forthnet.gr [77.49.164.141]) (authenticated bits=128) by igloo.linux.gr (8.14.3/8.14.3/Debian-5) with ESMTP id mB38o4HP012587 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 3 Dec 2008 10:50:10 +0200 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.14.3/8.14.3) with ESMTP id mB38o4Q9030947; Wed, 3 Dec 2008 10:50:04 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by kobe.laptop (8.14.3/8.14.3/Submit) id mB38o3mS030946; Wed, 3 Dec 2008 10:50:03 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) From: Giorgos Keramidas To: "Aggelidis Nikos" References: <30fc78250812020007h22ab0dc4if044e46b4f36b00c@mail.gmail.com> <20081202093544.a5cb8a21.freebsd@edvax.de> <30fc78250812022358v1970b4f6x6a1d6b3c9ca8f0c8@mail.gmail.com> Date: Wed, 03 Dec 2008 10:50:03 +0200 In-Reply-To: <30fc78250812022358v1970b4f6x6a1d6b3c9ca8f0c8@mail.gmail.com> (Aggelidis Nikos's message of "Wed, 3 Dec 2008 09:58:52 +0200") Message-ID: <87wsehprr8.fsf@kobe.laptop> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-MailScanner-ID: mB38o4HP012587 X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-3.857, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.54, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: Polytropon , freebsd-questions@freebsd.org Subject: Re: open multiple xterms with 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: Wed, 03 Dec 2008 08:50:30 -0000 On Wed, 3 Dec 2008 09:58:52 +0200, "Aggelidis Nikos" wrote: > Thank you for your help! > > some additional questions: > > 1) is there any way to give the root password once? i tried this: > #!/bin/sh > > su root -c "\ > xterm -geometry 80x25 -title 'App 1' -e 'app1' & > xterm -geometry 80x25 -title 'App 2' -e 'app2'\ > " > > but i get this: > xterm Xt error: Can't open display: %s su doesn't preserve the DISPLAY environment variable, so you can use one of the following: sudo bash -c "xterm & xterm &" su root -c "DISPLAY=$DISPLAY ; export DISPLAY ; xterm & xterm &" > i don't think i need something so complex. Is there any way to > instruct xterm not to close after the execution of the program? I'm not sure. It may be possible to play shell-specific tricks that cause `app1' to be executed as part of the shell's startup scripts.