Idenifying undefined variable in csh?

Idenifying undefined variable in csh?

Post by F. Lope » Thu, 23 Jan 1997 04:00:00



Hi,

if variable is var you must use:

if ($?var) then
# defined variable  
......
else
#undefined variable
   ......
endif



> Hi, there.

>   How can I know whether a variable is defined or not in csh script?

> Help.

> --
> Jin-Pyo Park               Tel) (02)880-8081                    
> Micro Architecture and System Software Lab. SNU

> URL    : http://altair.snu.ac.kr/~jp

 
 
 

Idenifying undefined variable in csh?

Post by Jinpyo Par » Thu, 23 Jan 1997 04:00:00


Hi, there.

  How can I know whether a variable is defined or not in csh script?

Help.

--
Jin-Pyo Park               Tel) (02)880-8081                    
Micro Architecture and System Software Lab. SNU

URL    : http://altair.snu.ac.kr/~jp

 
 
 

1. CSH: how to check undefined variable?

Can anyone tell me how to determine the undefined undefined variable?

My needs is, in the `if' statement, check if the given variable is
defined or not.

        if ( $MYENV <is undefined> ) then
                <do sometjhing>
        endif

Thanks in advance.
 Haru
--


ZEXEL USA, Inc.   (408) 738-4250 VOICE
265 Santa Ana Ct. (408) 738-4302 FAX  

2. sound

3. Variable depending on other variable. (csh)

4. Graphics Libraries

5. Variable variable names is csh

6. Frustrating problem

7. csh shell, problem with echoing variable variables...

8. Linux and 100-VG-Anylan

9. REPOST: csh: Exec format error/symbol is undefined

10. Undefined variables hang mod_perl

11. undefined variable M_DEVBUF and M_NOWAIT

12. una:undefined variable when running shell script

13. Undefined reference to <YOUR VARIABLE HERE>