home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / tcl / 2113 < prev    next >
Encoding:
Internet Message Format  |  1992-12-15  |  1.1 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!agate!saffron.CS.Berkeley.EDU!joel
  2. From: joel@saffron.CS.Berkeley.EDU (Joel A. Fine)
  3. Newsgroups: comp.lang.tcl
  4. Subject: Re: Help on reading shell variable/environment
  5. Date: 15 Dec 1992 22:39:11 GMT
  6. Organization: University of California, Berkeley
  7. Lines: 23
  8. Distribution: world
  9. Message-ID: <1glmqfINNfv5@agate.berkeley.edu>
  10. References: <1992Dec15.204940.15394@bnr.ca>
  11. NNTP-Posting-Host: saffron.cs.berkeley.edu
  12. Keywords: TCL/TK,variable,environment,shell
  13.  
  14. In article <1992Dec15.204940.15394@bnr.ca>, tdoan@bnr.ca (Tuan Doan) writes:
  15. |>    Does anyone know of a way to read shell variable or environment variable
  16. |> inside TCL/TK?  I need to access the TERM variable so that to prevent my
  17. |> TCL/TK program from being run when the user is not in an X window environment.
  18.  
  19. wish: echo $env(TERM)
  20. xterm
  21.  
  22. |> Also, is there an easy way to implement set operations in TCL/TK?
  23.  
  24. In extended tcl (which you can get from barkley.berkeley.edu), there's union
  25. and intersect:
  26.  
  27. tclX> set a [list a b c]
  28. tclX> set b [list b c d]
  29. tclX> union $a $b
  30. a b c d
  31. tclX> intersect $a $b
  32. b c
  33.  
  34.  
  35. - Joel Fine
  36.  
  37.