From owner-freebsd-questions@FreeBSD.ORG Sun Nov 26 08:51:07 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7F2C116A407 for ; Sun, 26 Nov 2006 08:51:07 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (ns0.infracaninophile.co.uk [81.187.76.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8141343D5C for ; Sun, 26 Nov 2006 08:50:12 +0000 (GMT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from [IPv6:::1] (localhost [IPv6:::1]) by smtp.infracaninophile.co.uk (8.13.8/8.13.8) with ESMTP id kAQ8oecT020440; Sun, 26 Nov 2006 08:50:41 GMT (envelope-from m.seaman@infracaninophile.co.uk) Authentication-Results: smtp.infracaninophile.co.uk from=m.seaman@infracaninophile.co.uk; sender-id=softfail; spf=softfail X-SenderID: Sendmail Sender-ID Filter v0.2.14 smtp.infracaninophile.co.uk kAQ8oecT020440 Message-ID: <4569555A.8010904@infracaninophile.co.uk> Date: Sun, 26 Nov 2006 08:50:34 +0000 From: Matthew Seaman Organization: Infracaninophile User-Agent: Thunderbird 1.5.0.8 (X11/20061110) MIME-Version: 1.0 To: Robin Becker References: <4568CF28.5050407@jessikat.plus.net> In-Reply-To: <4568CF28.5050407@jessikat.plus.net> X-Enigmail-Version: 0.94.0.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigAE46D57E09E3A3D855E15FBA" X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (smtp.infracaninophile.co.uk [IPv6:::1]); Sun, 26 Nov 2006 08:51:01 +0000 (GMT) X-Virus-Scanned: ClamAV 0.88.6/2242/Sat Nov 25 18:29:12 2006 on happy-idiot-talk.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, DKIM_POLICY_TESTING,NO_RELAYS autolearn=ham version=3.1.7 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on happy-idiot-talk.infracaninophile.co.uk Cc: FreeBSD-Questions Subject: Re: shell test for stdout=stderr 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 Nov 2006 08:51:07 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigAE46D57E09E3A3D855E15FBA Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Robin Becker wrote: > Is there a way for a shell script to test if 2> is the same as 1>? I > want to put messages in both when they are connected to different files= , > but would like to avoid duplicating the message when they are the same.= You could try using fstat(1) to print out the open file descriptors from your process: fstat -p $$ and then compare the values in the DEV and INUM columns -- unfortunately fstat has no way to map back from those device and inode values to filenames. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW --------------enigAE46D57E09E3A3D855E15FBA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFaVVg8Mjk52CukIwRCGnjAJ9sJW5msMNxOSHaaDT4TDNu1GsGxwCfSu0L M65zQRMDNR/XoGxeiYlUGCU= =U3id -----END PGP SIGNATURE----- --------------enigAE46D57E09E3A3D855E15FBA--