[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Tk experts?



On Mon, Jan 10, 2000 at 06:01:24PM +0000, Adrian Bridgett wrote:
> What I'm after is something like:

> if [ -z "$DISPLAY" ]; then
>   echo "No DISPLAY environment variable set - quiting"
>   exit 1
> fi

> however the closest I've got is:
 
> global env
> if {"$env(DISPLAY)" == ""}
> {
>  puts "No DISPLAY environment variable set - quiting"
>  exit 1
> }

With things like if's while's and such, you have to have the opening
bracket on the same line as the command:

#!/usr/bin/tclsh

if { $env(DISPLAY) == "" } {
    puts "NO DISPLAY SET"
} else {
    puts "DISPLAY SET"
}

Ciao,
-- 
  David N. Welton -+- davidw@prosa.it -+- http://www.efn.org/~davidw  


Reply to: