determining OS

determining OS

am 17.07.2007 22:55:09 von Greg Schraiber

Hi All!

I have a script (perl v5.8.5) that needs to run on both AIX and
linux. Does anyone have a code snippit that would allow the script
to determine which OS it is currently running under? Any help would
be greatly appreciated!

Thank you!
Greg


_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: determining OS

am 17.07.2007 23:14:10 von Curtis Leach

Try the following on each of the machines.

perl -w -e 'print $^O, "\n";'

Curtis

-----Original Message-----
From: activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of Greg
Schraiber
Sent: Tuesday, July 17, 2007 3:55 PM
To: activeperl@listserv.ActiveState.com
Subject: determining OS

Hi All!

I have a script (perl v5.8.5) that needs to run on both AIX and linux.
Does anyone have a code snippit that would allow the script to determine
which OS it is currently running under? Any help would be greatly
appreciated!

Thank you!
Greg


_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: determining OS

am 18.07.2007 07:49:45 von fzarabozo

--===============1323038601==
Content-Type: text/html; charset=iso-8859-1; format=flowed


Have you tried looking into the %ENV hash in each OS? There are generally particular keys and/or values that let you know where you are running.


HTH


Paco Zarabozo







From:  Greg Schraiber <schraibg@beloit.edu>
To:  activeperl@listserv.ActiveState.com
Subject:  determining OS
Date:  Tue, 17 Jul 2007 15:55:09 -0500
MIME-Version:  1.0
Received:  from mx.activestate.com ([209.17.146.130]) by bay0-mc9-f20.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Tue, 17 Jul 2007 13:55:23 -0700
Received:  from box14.activestate.com (unknown [192.168.70.104])by mx.activestate.com (Postfix) with ESMTP id B4D01A4601;Tue, 17 Jul 2007 13:55:06 -0700 (PDT)
Received:  from beloit.edu (beloit.edu [144.89.40.1])by mx.activestate.com (Postfix) with ESMTP id 955DDA45D8for <activeperl@listserv.ActiveState.com>;Tue, 17 Jul 2007 13:55:03 -0700 (PDT)
Received:  from
bcits5986.beloit.edu ([144.89.41.15])by beloit.edu (8.13.1/8.13.1) with ESMTP id l6HKt2bg001401for <activeperl@listserv.ActiveState.com>;Tue, 17 Jul 2007 15:55:02 -0500

>Hi All!
>
>I have a script (perl v5.8.5) that needs to run on both AIX  and
>linux.  Does anyone have a code snippit that would allow the script
>to determine which OS it is currently running under?  Any help would
>be greatly appreciated!
>
>Thank you!
>Greg
>
>
>_______________________________________________
>ActivePerl mailing list
>ActivePerl@listserv.ActiveState.com
>To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Tu horóscopo diario, semanal y gratuito. Cartas,
tarot y predicciones en MSN Horóscopo



--===============1323038601==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1323038601==--

Re: determining OS

am 18.07.2007 10:44:03 von Lim Ee Wah

--===============1638584652==
Content-Type: multipart/alternative;
boundary="----=_Part_71749_26686915.1184748243830"

------=_Part_71749_26686915.1184748243830
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hi

You can try read the $^O variable:

print $^O; #Mine is MSWin32.


On 7/18/07, Paco Zarabozo A. wrote:
>
> Have you tried looking into the %ENV hash in each OS? There are generall=
y
> particular keys and/or values that let you know where you are running.
>
> HTH
>
> Paco Zarabozo
>
> ------------------------------
> From: *Greg Schraiber *
> To: *activeperl@listserv.ActiveState.com*
> Subject: *determining OS*
> Date: *Tue, 17 Jul 2007 15:55:09 -0500*
> MIME-Version: *1.0*
> Received: *from mx.activestate.com ([209.17.146.130]) by
> bay0-mc9-f20.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Tue,
> 17 Jul 2007 13:55:23 -0700*
> Received: *from box14.activestate.com (unknown [192.168.70.104])by
> mx.activestate.com (Postfix) with ESMTP id B4D01A4601;Tue, 17 Jul 2007
> 13:55:06 -0700 (PDT)*
> Received: *from beloit.edu (beloit.edu [144.89.40.1])by
> mx.activestate.com (Postfix) with ESMTP id 955DDA45D8for <
> activeperl@listserv.ActiveState.com>;Tue, 17 Jul 2007 13:55:03 -0700 (PDT=
)
> *
> Received: *from bcits5986.beloit.edu ([144.89.41.15])by beloit.edu (
> 8.13.1/8.13.1) with ESMTP id l6HKt2bg001401for <
> activeperl@listserv.ActiveState.com>;Tue, 17 Jul 2007 15:55:02 -0500*
> >Hi All!
> >
> >I have a script (perl v5.8.5) that needs to run on both AIX and
> >linux. Does anyone have a code snippit that would allow the script
> >to determine which OS it is currently running under? Any help would
> >be greatly appreciated!
> >
> >Thank you!
> >Greg
> >
> >
> >_______________________________________________
> >ActivePerl mailing list
> >ActivePerl@listserv.ActiveState.com
> >To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs stserv.activestate.com/mailman/mysubs>
>
>
> ------------------------------
> Tu hor=F3scopo diario, semanal y gratuito. Cartas, tarot y predicciones e=
n
> MSN Hor=F3scopo
> _______________________________________________
> ActivePerl mailing list
> ActivePerl@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs tserv.activestate.com/mailman/mysubs>
>

------=_Part_71749_26686915.1184748243830
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hi

 

You can try read the $^O variable:

 

print $^O; #Mine is MSWin32.

 

On 7/18/07, =
Paco Zarabozo A.
<fzarabozo=
@hotmail.com
> wrote:

px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">


Have you tried looking into the %ENV hash in each OS? There are generall=
y particular keys and/or values that let you know where you are running. >

HTH


Paco Zarabozo



6e5 2px solid; MARGIN-RIGHT: 0px"> LY: tahoma,sans-serif">



From:  Greg Schraiber < js.OpenExtLink(window,event,this)" href=3D"mailto:schraibg@beloit.edu" targ=
et=3D"_blank">schraibg@beloit.edu
>

To:   ck=3D"return top.js.OpenExtLink(window,event,this)" href=3D"mailto:activepe=
rl@listserv.ActiveState.com" target=3D"_blank">
activeperl@listserv.ActiveState.com

Subject:  deter=
mining OS

Date:  Tue, 17 Jul 2007 15:55:09 -0500 >MIME-Version:  1.0
Received:  from lick=3D"return top.js.OpenExtLink(window,event,this)" href=3D"http://mx.act=
ivestate.com/" target=3D"_blank">
mx.activestate.com
([ nt,this)" href=3D"http://209.17.146.130/" target=3D"_blank">209.17.146.130<=
/a>]) by
=3D"http://bay0-mc9-f20.bay0.hotmail.com/" target=3D"_blank">
bay0-mc9-f20.bay0.hotmail.com
with Microsoft SMTPSVC(6.0.3790.2668); Tu=
e, 17 Jul 2007 13:55:23 -0700

Received:  from k=3D"return top.js.OpenExtLink(window,event,this)" href=3D"http://box14.act=
ivestate.com/" target=3D"_blank">
box14.activestate.com
(unknown [ (window,event,this)" href=3D"http://192.168.70.104/" target=3D"_blank">192.=
168.70.104
])by s)" href=3D"http://mx.activestate.com/" target=3D"_blank">
mx.activestate.com
(Postfix) with ESMTP id B4D01A4601;Tue, 17 Jul 2007 =
13:55:06 -0700 (PDT)

Received:  from rn top.js.OpenExtLink(window,event,this)" href=3D"http://beloit.edu/" targe=
t=3D"_blank">
beloit.edu
( href=3D"http://beloit.edu/" target=3D"_blank">beloit.edu [ =3D"return top.js.OpenExtLink(window,event,this)" href=3D"http://144.89.40.=
1/" target=3D"_blank">
144.89.40.1
])by is)" href=3D"http://mx.activestate.com/" target=3D"_blank">mx.activestate.c=
om
(Postfix) with ESMTP id 955DDA45D8for < s.OpenExtLink(window,event,this)" href=3D"mailto:activeperl@listserv.Active=
State.com" target=3D"_blank">
activeperl@listserv.ActiveState.com
>;Tue, 17 Jul 2007 13:55:03 -0700=
(PDT)

Received:  from ExtLink(window,event,this)" href=3D"http://bcits5986.beloit.edu/" target=3D=
"_blank">bcits5986.beloit.edu
([ http://144.89.41.15/" target=3D"_blank">144.89.41.15])by return top.js.OpenExtLink(window,event,this)" href=3D"http://beloit.edu/" t=
arget=3D"_blank">
beloit.edu
(8.13.1/8.13.1) with ESMTP id l6HKt2bg001401for < ck=3D"return top.js.OpenExtLink(window,event,this)" href=3D"mailto:activepe=
rl@listserv.ActiveState.com" target=3D"_blank">activeperl@listserv.ActiveSt=
ate.com
>;Tue, 17 Jul 2007 15:55:02 -0500

>Hi All!
>
>=
I have a script (perl v5.8.5) that needs to run on both AIX  and<=
br>>linux.  Does anyone have a code snippit that would allow t=
he script
>to determine which OS it is currently running under? =
 Any help would

>be greatly appreciated!
>
>Thank you!
>Greg
&g=
t;
>
>_______________________________________________
>Ac=
tivePerl mailing list
> ,event,this)" href=3D"mailto:ActivePerl@listserv.ActiveState.com" target=3D=
"_blank">
ActivePerl@listserv.ActiveState.com

>To unsubscribe: =3D"return top.js.OpenExtLink(window,event,this)" href=3D"http://listserv.a=
ctivestate.com/mailman/mysubs" target=3D"_blank">http://listserv.ActiveStat=
e.com/mailman/mysubs





Tu hor=F3scopo diario, semanal y gratuito. ExtLink(window,event,this)" href=3D"http://g.msn.com/8HMAESES/2728??PS=3D47=
575" target=3D"_blank">Cartas, tarot y predicciones en MSN Hor=F3scopo
=


_______________________________________________
ActivePerl mailing l=
ist
mailto:ActivePerl@listserv.ActiveState.com">ActivePerl@lists erv.ActiveState=
..com

To unsubscribe: t,this)" href=3D"http://listserv.activestate.com/mailman/mysubs" target=3D"=
_blank">http://listserv.ActiveState.com/mailman/mysubs

=




------=_Part_71749_26686915.1184748243830--

--===============1638584652==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1638584652==--

RE: determining OS

am 18.07.2007 11:18:38 von Brian Raven

Greg Schraiber <> wrote:
> Hi All!
> =

> I have a script (perl v5.8.5) that needs to run on both AIX and
> linux. Does anyone have a code snippit that would allow the script
> to determine which OS it is currently running under? Any help would
> be greatly appreciated! =


As others have mentioned, $^O will probably be good enough to
distinguish between those OSs (see 'perldoc perlvar'). Run the following
command on each platform to tell you what to look for:

perl -e "print qq{$^O\n}"

If you need more detailed, or finer grained, platform dependent
information use the Config module (see 'perldoc Config').

HTH

-- =

Brian Raven =


==================== =====3D=
================
Atos Euronext Market Solutions Disclaimer
==================== =====3D=
================

The information contained in this e-mail is confidential and solely for the=
intended addressee(s). Unauthorised reproduction, disclosure, modification=
, and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender immediat=
ely and delete it from your system. The views expressed in this message do =
not necessarily reflect those of Atos Euronext Market Solutions.

Atos Euronext Market Solutions Limited - Registered in England & Wales with=
registration no. 3962327. Registered office address at 25 Bank Street Lon=
don E14 5NQ United Kingdom. =

Atos Euronext Market Solutions SAS - Registered in France with registration=
no. 425 100 294. Registered office address at 6/8 Boulevard Haussmann 750=
09 Paris France.

L'information contenue dans cet e-mail est confidentielle et uniquement des=
tinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. Tou=
te copie, publication ou diffusion de cet email est interdite. Si cet e-mai=
l vous parvient par erreur, nous vous prions de bien vouloir prevenir l'exp=
editeur immediatement et d'effacer le e-mail et annexes jointes de votre sy=
steme. Le contenu de ce message electronique ne represente pas necessaireme=
nt la position ou le point de vue d'Atos Euronext Market Solutions.
Atos Euronext Market Solutions Limited Soci=E9t=E9 de droit anglais, enregi=
str=E9e au Royaume Uni sous le num=E9ro 3962327, dont le si=E8ge social se =
situe 25 Bank Street E14 5NQ Londres Royaume Uni.

Atos Euronext Market Solutions SAS, soci=E9t=E9 par actions simplifi=E9e, e=
nregistr=E9 au registre dui commerce et des soci=E9t=E9s sous le num=E9ro 4=
25 100 294 RCS Paris et dont le si=E8ge social se situe 6/8 Boulevard Hauss=
mann 75009 Paris France.
==================== =====3D=
================

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: determining OS

am 18.07.2007 14:37:21 von Greg Schraiber

Thank you to all that responded. The variable $^O was exactly what I
was looking for.

Thanks again,
Greg



Hi All!

I have a script (perl v5.8.5) that needs to run on both AIX and
linux. Does anyone have a code snippit that would allow the script
to determine which OS it is currently running under? Any help would
be greatly appreciated!

Thank you!
Greg


_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


=================================
Gregory J Schraiber
Information Services & Resources
608-363-2456 schraibg@beloit.edu
=================================


_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs