Help on reading shell variable/environment 
Author Message
 Help on reading shell variable/environment

Hello,

   Does anyone know of a way to read shell variable or environment variable
inside TCL/TK?  I need to access the TERM variable so that to prevent my
TCL/TK program from being run when the user is not in an X window environment.

Also, is there an easy way to implement set operations in TCL/TK?  For example,

   set lista [list a b c]
   set listb [list b c d]
   set listc [and lista listb]        -> listc={b,c}
   set listd [or lista listb]         -> listd={a,b,c,d}

One of the nifty functionality that TCL/TK provides is list.  Unfortunately,
no logic's operators on it.

Regards,

 __  __/  /   /   __  /    |   /    Tuan T. Doan
    /    /   /   /   /   / |  /     Advance Signalling Design
   /    /   /   __  /   /  | /      2201 Lakeside Blvd.  P.O. Box 833871
__/  ______/ __/ __/ __/  __/       Richardson, TX 75083-3871
                                    Phone: 6-444-4575/214-684-4575




Sun, 04 Jun 1995 04:49:40 GMT  
 Help on reading shell variable/environment
|>    Does anyone know of a way to read shell variable or environment variable
|> inside TCL/TK?  I need to access the TERM variable so that to prevent my
|> TCL/TK program from being run when the user is not in an X window environment.

wish: echo $env(TERM)
xterm

|> Also, is there an easy way to implement set operations in TCL/TK?

In extended tcl (which you can get from barkley.berkeley.edu), there's union
and intersect:

tclX> set a [list a b c]
tclX> set b [list b c d]
tclX> union $a $b
a b c d
tclX> intersect $a $b
b c

- Joel Fine



Sun, 04 Jun 1995 06:39:11 GMT  
 Help on reading shell variable/environment


: |>    Does anyone know of a way to read shell variable or environment variable
: |> inside TCL/TK?  I need to access the TERM variable so that to prevent my
: |> TCL/TK program from being run when the user is not in an X window environment.
:
: wish: echo $env(TERM)
: xterm

Or maybe this:

wish: if {[info exists env(TERM)]} {set term $env(TERM)}

--
Bob Bagwill



Sun, 04 Jun 1995 22:30:18 GMT  
 Help on reading shell variable/environment

   : |> inside TCL/TK?  I need to access the TERM variable so that to prevent my
   : |> TCL/TK program from being run when the user is not in an X window
        environment.
   :
   : wish: echo $env(TERM)
   : xterm

   Or maybe this:

   wish: if {[info exists env(TERM)]} {set term $env(TERM)}

How about checking for DISPLAY instead.  TERM is irrelevent to X.



Tue, 06 Jun 1995 09:40:32 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Read Shell Environment Variables (Strings) into Verilog-XL?

2. python, shell, environment variable

3. using rsh to read remote environment variables

4. Reading DOS environment variables from c4b

5. Read COMSPEC environment variable at runtime?

6. How to read environment variables in OS/2 ReXX

7. How to read environment variables us

8. How to read environment variables us

9. How to read environment variables using aix and rexx

10. Reading environment variables in ADA?

11. read environment variables

12. Reading Environment Variables

 

 
Powered by phpBB® Forum Software