Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

weird behavior of tclsh
I think I am missing something badly.

I have lappend auto_path in my .tclshrc.
Isn't .tclshrc executed everytime you invoke tclsh?

Why am I getting 2 different outputs (and behaviors) when I do "tclsh
a.tcl" versus invoking tclsh and then sourcing a.tcl?

Thanks in advance,
-Bhushit

bhushit@jungle:/home/bhushit/learn/tcl/graph: head ~/.tclshrc
lappend auto_path <foo>/lib/tcllib
package require control
package require struct

bhushit@jungle:/home/bhushit/learn/tcl/graph: cat temp.tcl
puts $auto_path

bhushit@jungle:/home/bhushit/learn/tcl/graph: tclsh temp.tcl
<bar>/tcl8.3.3/lib/tcl8.3 <bar>/tcl8.3.3/lib /import/tools/lib

BUT

bhushit@jungle:/home/bhushit/learn/tcl/graph: tclsh
=========
8.3:/home/bhushit/learn/tcl/graph:-> source temp.tcl
<bar>/tcl8.3.3/lib/tcl8.3 <bar>/tcl8.3.3/lib /import/tools/lib
<foo>/lib/tcllib <foo>/lib/tcllib/control

Report this thread to moderator Post Follow-up to this message
Old Post
Bhushit Joshipura
07-31-04 08:56 AM


Re: weird behavior of tclsh
Bhushit Joshipura wrote:
> I have lappend auto_path in my .tclshrc.
> Isn't .tclshrc executed everytime you invoke tclsh?

No.

http://www.tcl.tk/man/tcl8.4/UserCmd/tclsh.htm

"There is no automatic evaluation of .tclshrc when the name of a
script file is presented on the tclsh command line, but the script
file can always source it if desired."

--
| Don Porter          Mathematical and Computational Sciences Division |
| donald.porter@nist.gov             Information Technology Laboratory |
| http://math.nist.gov/~DPorter/                                  NIST |
 |_______________________________________
_______________________________|

Report this thread to moderator Post Follow-up to this message
Old Post
Don Porter
07-31-04 08:56 AM


Re: weird behavior of tclsh
Bhushit Joshipura wrote:
> I have lappend auto_path in my .tclshrc.

What you probably want to use instead is the TCLLIBPATH
environment variable.

--
| Don Porter          Mathematical and Computational Sciences Division |
| donald.porter@nist.gov             Information Technology Laboratory |
| http://math.nist.gov/~DPorter/                                  NIST |
 |_______________________________________
_______________________________|

Report this thread to moderator Post Follow-up to this message
Old Post
Don Porter
07-31-04 08:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Tcl archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:31 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.