if [info exists env(HOME)] {
set dir $env(HOME)
} else {
# the environment var isn't set, use a default
puts "Pas de variable home"
set dir "/tmp"
}
I don't understand why this code don't work!
Thanx for your replies.
I don't see anything wrong with the code you posted, and it worked fine on both my Windows 2000 and Linux systems.
In what way is it "failing" for you? About the only "typical" problem I can think of with code like this is if you're running it from the Unix cron utility, which has a very limited set of environment variables set. (On my Mandrake Linux 8.1 system, the environment variables, as specified in /etc/crontab, include a setting of HOME to "/".) - Ken Jones, President, ken@avia-training.com
Avia Training and Consulting,
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.