From owner-freebsd-questions@FreeBSD.ORG Wed Dec 3 13:36:23 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 930BC1065672 for ; Wed, 3 Dec 2008 13:36:23 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id 532C08FC13 for ; Wed, 3 Dec 2008 13:36:23 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r55.edvax.de (port-92-196-24-200.dynamic.qsc.de [92.196.24.200]) by mx01.qsc.de (Postfix) with ESMTP id A1A093E964; Wed, 3 Dec 2008 14:36:18 +0100 (CET) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id mB3DaEKs001579; Wed, 3 Dec 2008 14:36:14 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Wed, 3 Dec 2008 14:36:14 +0100 From: Polytropon To: "Aggelidis Nikos" Message-Id: <20081203143614.bd0ef0cc.freebsd@edvax.de> In-Reply-To: <30fc78250812022358v1970b4f6x6a1d6b3c9ca8f0c8@mail.gmail.com> References: <30fc78250812020007h22ab0dc4if044e46b4f36b00c@mail.gmail.com> <20081202093544.a5cb8a21.freebsd@edvax.de> <30fc78250812022358v1970b4f6x6a1d6b3c9ca8f0c8@mail.gmail.com> Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: 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 Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2008 13:36:23 -0000 On Wed, 3 Dec 2008 09:58:52 +0200, "Aggelidis Nikos" wrote: > some additional questions: >=20 > 1) is there any way to give the root password once? i tried this: > #!/bin/sh >=20 > su root -c "\ > xterm -geometry 80x25 -title 'App 1' -e 'app1' & > xterm -geometry 80x25 -title 'App 2' -e 'app2'\ > " >=20 > but i get this: > xterm Xt error: Can't open display: %s Exactly. When you su root, $DISPLAY is not set, so you would have to set it first, maybe like this: #!/bin/sh su root -c "\ export DISPLAY=3D:0.0; \ xterm -geometry 80x25 -title 'App 1' -e 'app1' & xterm -geometry 80x25 -title 'App 2' -e 'app2' \ " > 2) > Is there any way to > instruct xterm not to close after the execution of the program? You could do this: xterm -geometry 80x25 -title 'App 1' -e 'app1 ; csh' & which would start your prefered dialog shell when "app1" has finished. The dialog shell would run even if "app" fails (that=C4s why I suggest using ; instead of &&). > So basically the idea is open 4 terminals, execute a specific command > inside them but if the command finishes or stops, the terminal stays > {with a new prompt}. This sould be able to be achieved using the example above. --=20 Polytropon >From Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...