Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Acces Cshell environmt variable

Status
Not open for further replies.

Anto35

Technical User
May 16, 2002
25
0
0
FR
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, 866-TCL-HELP (866-825-4357) US Toll free
415-643-8692 Voice
415-643-8697 Fax
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top