|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi,
Sorry, this is probably a really basic question. I'm running into a problem where my csh script stops because it's referencing environment variables that have not been set. In order to prevent this from happening, I'd like to behave gracefully if the environment variable isn't set, instead of just getting the "Undefined variable" message. Is there a way to check if an environment variable is set before using it in csh? Thanks! Michael Jeung |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
In article <1180113185.243991.198730@x18g2000prd.googlegroups .com>,
<jeungster@gmail.com> wrote: >Hi, > >Sorry, this is probably a really basic question. I'm running into a >problem where my csh script stops because it's referencing environment >variables that have not been set. > >In order to prevent this from happening, I'd like to behave gracefully >if the environment variable isn't set, instead of just getting the >"Undefined variable" message. > >Is there a way to check if an environment variable is set before using >it in csh? > >Thanks! >Michael Jeung > if $?foo ... |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
> if $?foo ... Thanks! That's works exactly. |
|
![]() |
| Outils de la discussion | |
|
|