From owner-freebsd-questions Sun Mar 24 11:51:29 2002 Delivered-To: freebsd-questions@freebsd.org Received: from Mail6.nc.rr.com (fe6.southeast.rr.com [24.93.67.53]) by hub.freebsd.org (Postfix) with ESMTP id F07DC37B417 for ; Sun, 24 Mar 2002 11:51:24 -0800 (PST) Received: from i8k.babbleon.org ([66.57.85.154]) by Mail6.nc.rr.com with Microsoft SMTPSVC(5.5.1877.687.68); Sun, 24 Mar 2002 14:51:10 -0500 Received: by i8k.babbleon.org (Postfix, from userid 111) id EF418BA05; Sun, 24 Mar 2002 14:50:45 -0500 (EST) Content-Type: text/plain; charset="iso-8859-1" From: Brian T.Schellenberger To: "Charles Burns" , ilia@chel.skbkontur.ru, questions@FreeBSD.ORG Subject: Re: Perl thing Date: Sun, 24 Mar 2002 14:50:45 -0500 X-Mailer: KMail [version 1.3] References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <20020324195045.EF418BA05@i8k.babbleon.org> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sunday 24 March 2002 02:46 pm, Charles Burns wrote: | IANAPP (Perl Programmer) but I know that Perl is great for text parsing. | One way that you could do this, though it wouldn't exactly be elegant, | would be to parse the output of (say) dmesg. Surely though, there are | better ways. | | >Dear Sirs, | > | >is there anything that I could use it in perl program like I can write in | >C: | > | >#ifdef __FreeBSD__ | > | >#endif | > | >??? | > | >I want to port some perl program that it could run either on FreeBSD or | >any other system... Howzabout if ($ENV{'OSTYPE'} eq 'FreeBSD') { } I'm not an expert on this; I just did a printenv | grep BSD and both OSTYPE and HOSTTYPE are set to FreeBSD. I'm not sure if that's always the case, but I do know that it's always the case that you can use $ENV to get to environment variables. I also checked, and these are set for root and for a from-scratch user account, so they are probably safely universal. | | _________________________________________________________________ | Chat with friends online, try MSN Messenger: http://messenger.msn.com | | | To Unsubscribe: send mail to majordomo@FreeBSD.org | with "unsubscribe freebsd-questions" in the body of the message -- Brian T. Schellenberger . . . . . . . bts@wnt.sas.com (work) Brian, the man from Babble-On . . . . bts@babbleon.org (personal) ME --> http://www.babbleon.org http://www.eff.org <-- GOOD GUYS --> http://www.programming-freedom.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message