Mailinglist Archive: opensuse-programming (84 mails)

< Previous Next >
Re: [suse-programming-e] Minor tcsh problem (undefined variable message).. .
  • From: "William A. Mahaffey III" <wam@xxxxxxxxxx>
  • Date: Wed, 11 Aug 2004 08:14:23 -0500
  • Message-id: <411A1BAF.5090502@xxxxxxxxxx>
dries wrote:

Hello all,, ,
I've made tcsh script that uses a environment variable that can be defined or not, the script works, but if the variable is not defined i get the message
'carrotcount: Undefined variable.'

from the example script below . . .

#!/usr/bin/tcsh
echo $carrotcount

My question is : is there a way to suppress the 'undefined variable' message or can i check wether it is defined (in a tcsh script) . .
Grtz Dries Pruimboom


man tcsh on my SuSE 8.2 turned up this under the "Variables" section :

.
.
.
.


The following substitutions can not be modified with `:' modifiers.

$?name
${?name}
Substitutes the string `1' if name is set, `0' if it is not.


HTH, YMMV, & all that.


< Previous Next >
References