Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!mit-eddie!mit-amt!garp!henry From: henry@garp.mit.edu (Henry Mensch) Newsgroups: comp.unix.questions Subject: Re: Environment variables Message-ID: <1493@mit-amt.MEDIA.MIT.EDU> Date: Thu, 27-Aug-87 13:08:10 EDT Article-I.D.: mit-amt.1493 Posted: Thu Aug 27 13:08:10 1987 Date-Received: Sat, 29-Aug-87 09:52:46 EDT References: <626@unmvax.unm.edu> <2876@phri.UUCP> Sender: usenet@mit-amt.MEDIA.MIT.EDU Reply-To: henry@garp.UUCP (Henry Mensch) Organization: The Temple of St. Todd the Incontinent Lines: 26 roy@phri.UUCP (Roy Smith) wrote: ->In <626@unmvax.unm.edu> mike@turing.UNM.EDU.UUCP (Michael I. Bushnell) writes: ->> How can I determine if an environment variable is set using csh? ->> (I.e., in a script) -> -> After a bit of experimentation, I came up with the following -> -> . . . (shell script removed here) -> -> This works, but is a bit grotty. I suspect there has to be a ->prettier way to do it, but I don't see any. Yeah; try this: 61 garp /users/henry --> printenv PRINTER ; set in my .{login,cshrc} ln03-bldge40-2 62 garp /users/henry --> printenv DEADLY ; some random name 63 garp /users/henry --> echo ${?PRINTER} ${?DEADLY} 1 0 64 garp /users/henry --> ${?variablename} returns 1 if set and 0 if not set. Oh yeah; this was described in the manual page for csh that I have. # Henry Mensch / / E40-379 MIT, Cambridge, MA # {ames,cca,rochester,harvard,mit-eddie}!garp!henry