determining os in an expect or tcl script

determining os in an expect or tcl script

Post by morde » Fri, 07 Mar 2003 08:45:52



How could I find out what operating system the script is running on?
Parameters to lpr
seem to vary from one printing system to another :-[
set in bash shows there's MACHTYPE specifying what's the platform
but export does not show it.
Consequently expect bombs out while attempting to access $env(MACHTYPE) ...
 
 
 

determining os in an expect or tcl script

Post by Joshua Jone » Fri, 07 Mar 2003 09:21:09



Quote:> How could I find out what operating system the script is running on?
> Parameters to lpr
> seem to vary from one printing system to another :-[
> set in bash shows there's MACHTYPE specifying what's the platform
> but export does not show it.
> Consequently expect bombs out while attempting to access $env(MACHTYPE) ...

man uname

--
 josh(at)cc.gatech.edu  |  http://intmain.net:800

 460868 local keystrokes since last reboot (42 days ago)

 
 
 

determining os in an expect or tcl script

Post by Jeff Godfre » Fri, 07 Mar 2003 09:32:34



Quote:> How could I find out what operating system the script is running on?
> Parameters to lpr
> seem to vary from one printing system to another :-[
> set in bash shows there's MACHTYPE specifying what's the platform
> but export does not show it.
> Consequently expect bombs out while attempting to access $env(MACHTYPE)

...

Something from of the global "tcl_platform" array should contain something
of use to you:

(bin) 5 % parray ::tcl_platform
::tcl_platform(byteOrder) = littleEndian
::tcl_platform(machine)   = intel
::tcl_platform(os)        = Windows 95
::tcl_platform(osVersion) = 4.10
::tcl_platform(platform)  = windows
::tcl_platform(user)      = jgodfrey
::tcl_platform(wordSize)  = 4

HTH,

Jeff

 
 
 

determining os in an expect or tcl script

Post by Josef M?ller » Fri, 07 Mar 2003 16:51:18



> How could I find out what operating system the script is running on?
> Parameters to lpr
> seem to vary from one printing system to another :-[
> set in bash shows there's MACHTYPE specifying what's the platform
> but export does not show it.
> Consequently expect bombs out while attempting to access $env(MACHTYPE) ...

If providing suitable options to lpr (and similar problems), embedding
numerous variants of lpr into your program is probably not a sensible
thing.
I'd add some kind of config file which has the appropriate command line
to perform whatever function you want and extract the command from that
file.

--
Josef M?llers (Pinguinpfleger bei FSC)
        If failure had no penalty success would not be a prize
                                                -- T.  Pratchett

 
 
 

determining os in an expect or tcl script

Post by Arjen Marku » Fri, 07 Mar 2003 17:49:34




> > How could I find out what operating system the script is running on?
> > Parameters to lpr
> > seem to vary from one printing system to another :-[
> > set in bash shows there's MACHTYPE specifying what's the platform
> > but export does not show it.
> > Consequently expect bombs out while attempting to access $env(MACHTYPE) ...

> If providing suitable options to lpr (and similar problems), embedding
> numerous variants of lpr into your program is probably not a sensible
> thing.
> I'd add some kind of config file which has the appropriate command line
> to perform whatever function you want and extract the command from that
> file.

> --
> Josef M?llers (Pinguinpfleger bei FSC)
>         If failure had no penalty success would not be a prize
>                                                 -- T.  Pratchett

Have you looked at the array tcl_platform?
<http://wiki.tcl.tk/tcl_platform>
lists all kinds of possibilities.

Regards,

Arjen

 
 
 

determining os in an expect or tcl script

Post by morde » Sat, 08 Mar 2003 10:35:42





> >How could I find out what operating system the script is running on?
> >Parameters to lpr
> >seem to vary from one printing system to another :-[
> >set in bash shows there's MACHTYPE specifying what's the platform
> >but export does not show it.
> >Consequently expect bombs out while attempting to access $env(MACHTYPE)

> ...

> Something from of the global "tcl_platform" array should contain something
> of use to you:

> (bin) 5 % parray ::tcl_platform
> ::tcl_platform(byteOrder) = littleEndian
> ::tcl_platform(machine)   = intel
> ::tcl_platform(os)        = Windows 95
> ::tcl_platform(osVersion) = 4.10
> ::tcl_platform(platform)  = windows
> ::tcl_platform(user)      = jgodfrey
> ::tcl_platform(wordSize)  = 4

> HTH,

> Jeff

Ok. Thank you:
::tcl_platform(byteOrder) = littleEndian
::tcl_platform(machine)   = i686
::tcl_platform(os)        = Linux
::tcl_platform(osVersion) = 2.4.18-18.7.xsmp
::tcl_platform(platform)  = unix

So many toys, so little time :(

 
 
 

determining os in an expect or tcl script

Post by Jeff Godfre » Sat, 08 Mar 2003 14:44:59




> > Something from of the global "tcl_platform" array should contain
something
> > of use to you:

> > (bin) 5 % parray ::tcl_platform
> > ::tcl_platform(byteOrder) = littleEndian
> > ::tcl_platform(machine)   = intel
> > ::tcl_platform(os)        = Windows 95
> > ::tcl_platform(osVersion) = 4.10
> > ::tcl_platform(platform)  = windows
> > ::tcl_platform(user)      = jgodfrey
> > ::tcl_platform(wordSize)  = 4

> > HTH,

> > Jeff

> Ok. Thank you:
> ::tcl_platform(byteOrder) = littleEndian
> ::tcl_platform(machine)   = i686
> ::tcl_platform(os)        = Linux
> ::tcl_platform(osVersion) = 2.4.18-18.7.xsmp
> ::tcl_platform(platform)  = unix

> So many toys, so little time :(

Hmmmm...  Just noticed that in my reply (above) to the OP, my "os" is listed
as "Windows 95".  The box I cut and pasted that session from is running '98.
Does '98 not have it's own ID string?  Just curious...

Jeff

 
 
 

determining os in an expect or tcl script

Post by morde » Sun, 09 Mar 2003 08:58:45






> >>Something from of the global "tcl_platform" array should contain

> something

> >>of use to you:

> >>(bin) 5 % parray ::tcl_platform
> >>::tcl_platform(byteOrder) = littleEndian
> >>::tcl_platform(machine)   = intel
> >>::tcl_platform(os)        = Windows 95
> >>::tcl_platform(osVersion) = 4.10
> >>::tcl_platform(platform)  = windows
> >>::tcl_platform(user)      = jgodfrey
> >>::tcl_platform(wordSize)  = 4

> >>HTH,

> >>Jeff

> >Ok. Thank you:
> >::tcl_platform(byteOrder) = littleEndian
> >::tcl_platform(machine)   = i686
> >::tcl_platform(os)        = Linux
> >::tcl_platform(osVersion) = 2.4.18-18.7.xsmp
> >::tcl_platform(platform)  = unix

> >So many toys, so little time :(

> Hmmmm...  Just noticed that in my reply (above) to the OP, my "os" is
> listed
> as "Windows 95".  The box I cut and pasted that session from is
> running '98.
> Does '98 not have it's own ID string?  Just curious...

98's not an OS, it's a patch for 95 :^)
Just, kidding, kidding.
 
 
 

determining os in an expect or tcl script

Post by Jeff Godfre » Sun, 09 Mar 2003 10:29:42




> > Hmmmm...  Just noticed that in my reply (above) to the OP, my "os" is
> > listed
> > as "Windows 95".  The box I cut and pasted that session from is
> > running '98.
> > Does '98 not have it's own ID string?  Just curious...

> 98's not an OS, it's a patch for 95 :^)
> Just, kidding, kidding.

I fully expected some digs on this one.  I'm kind of surprised it didn't
draw more fire...   ;^)
What can I say... It gets me by for right now.

Jeff