LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-01-2008, 09:31 AM   #1
sharky
Member
 
Registered: Oct 2002
Posts: 569

Rep: Reputation: 84
tcl/tk $env(HOME) not found inside proc


In a tcl/tk script I can have the command 'cd $env(HOME)' and it works. I verified that it works by 'puts [exec "ls"] and seeing that the output is from my home directory. However, if I put this line inside a proc the variable is not found.

As a work around I set a global variable to $env(HOME) outside the proc and pass $HOME to the proc. I'll be using a lot of environment variables in my scripts and this workaround is cumbersome. Is there a way to make environment variables such as $env(HOME) global?
 
Old 06-01-2008, 02:39 PM   #2
sharky
Member
 
Registered: Oct 2002
Posts: 569

Original Poster
Rep: Reputation: 84
This worked

Using $::env(HOME) within a proc worked.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
contents of 'home' directory found at sda5: mounted as /home, and also on sda6:/home leswatson Linux - Newbie 4 04-18-2008 04:02 PM
Help with installing tcl into home directory tuxfood Debian 3 07-31-2005 06:22 AM
default.hotplug: line 1: env: command not found voyciz Slackware 2 03-04-2005 09:44 AM
execute shell command inside of tcl file khucinx Programming 1 07-05-2004 01:29 PM
Cannot Enter chroot /usr/bin/env directory not found Zero-0-Effect Linux From Scratch 2 03-13-2004 12:41 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration