From owner-freebsd-questions@FreeBSD.ORG Thu Jul 3 15:36:27 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 50C16106568B for ; Thu, 3 Jul 2008 15:36:27 +0000 (UTC) (envelope-from freebsd-questions@slightlystrange.org) Received: from mtaout01-winn.ispmail.ntl.com (mtaout01-winn.ispmail.ntl.com [81.103.221.47]) by mx1.freebsd.org (Postfix) with ESMTP id B090B8FC23 for ; Thu, 3 Jul 2008 15:36:26 +0000 (UTC) (envelope-from freebsd-questions@slightlystrange.org) Received: from aamtaout01-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout01-winn.ispmail.ntl.com with ESMTP id <20080703154103.RNUA28496.mtaout01-winn.ispmail.ntl.com@aamtaout01-winn.ispmail.ntl.com> for ; Thu, 3 Jul 2008 16:41:03 +0100 Received: from catflap.slightlystrange.org ([86.6.1.242]) by aamtaout01-winn.ispmail.ntl.com with ESMTP id <20080703154236.WPWD16854.aamtaout01-winn.ispmail.ntl.com@catflap.slightlystrange.org> for ; Thu, 3 Jul 2008 16:42:36 +0100 Received: by catflap.slightlystrange.org (Postfix, from userid 106) id C2C246152; Thu, 3 Jul 2008 16:36:22 +0100 (BST) Received: from torus.slightlystrange.org (torus.slightlystrange.org [10.1.3.50]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by catflap.slightlystrange.org (Postfix) with ESMTPS id 83E7360F8 for ; Thu, 3 Jul 2008 16:36:22 +0100 (BST) Received: (from danielby@localhost) by torus.slightlystrange.org (8.14.2/8.13.4/Submit) id m63FaLwM059081 for freebsd-questions@FreeBSD.ORG; Thu, 3 Jul 2008 16:36:21 +0100 (BST) (envelope-from freebsd-questions@slightlystrange.org) Date: Thu, 3 Jul 2008 16:36:20 +0100 From: Daniel Bye To: FreeBSD Mailing List Message-ID: <20080703153620.GA37232@torus.slightlystrange.org> Mail-Followup-To: FreeBSD Mailing List References: <20080703021344.GA73949@thought.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fUYQa+Pmc3FrFX/N" Content-Disposition: inline In-Reply-To: <20080703021344.GA73949@thought.org> User-Agent: Mutt/1.4.2.3i X-PGP-Fingerprint: D349 B109 0EB8 2554 4D75 B79A 8B17 F97C 1622 166A X-Operating-System: FreeBSD 7.0-STABLE i386 Cc: Subject: Re: to shell (and X window System) wizards. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Bye List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jul 2008 15:36:27 -0000 --fUYQa+Pmc3FrFX/N Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 02, 2008 at 07:13:50PM -0700, Gary Kline wrote: >=20 > would this works, say in .zlogin, to say that X is up: >=20 > if [ -e /tmp/.X11-unix/X0 ] > then > echo "X is up." > exit 0; > else > echo "No X yet" > exit 1; > fi >=20 > or is there something more clever? I'm not sure if it's any cleverer, but I would probably make a call to pgrep(1) instead of relying on the existence of a file that might exist, even if X isn't running (unusual, but it does happen now and then, here at least) - something like if (pgrep "Xorg") then echo "X is up." exit 0 else echo "No X yet..." exit 1 fi =2E.. should do the trick. And bear in mind that ~/.zlogin is run *after* ~/.zshrc, whereas ~/.zprofile is run *before* it. It might matter, depending on what you are trying to do. Dan --=20 Daniel Bye _ ASCII ribbon campaign ( ) - against HTML, vCards and X - proprietary attachments in e-mail / \ --fUYQa+Pmc3FrFX/N Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkhs8fQACgkQixf5fBYiFmpyKACgmqHkDUfXldzD6RT/IuiJEXks vvMAnilW9AWenY5UMucRcm3aTzMNvoYT =hBGJ -----END PGP SIGNATURE----- --fUYQa+Pmc3FrFX/N--