LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-10-2014, 12:07 PM   #1
bayefalle
LQ Newbie
 
Registered: Aug 2014
Posts: 10

Rep: Reputation: Disabled
used a same name variable in differents file TCL


Hello evrybody,

i'm working in tcl and i want to know how to used a variabl name in a differents files TCL. For exampl:
I calculate the amount of energy in a file file1.tcl and i want to use the result (i.e the amount of energy) in the file file2.tcl

Pleasse help me
 
Old 12-10-2014, 02:06 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
You need to be more specific and provide more info on these scripts. Did you write them? Do they require any arguments? Do they output anything? Could you post them?. Typically you would output the desired quantity in file1, and capture it in file2. In Bash it would look something like "energy=$(./file1.tcl)", I'm sure there's something similar in tcl.
 
Old 12-10-2014, 02:20 PM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
← #2 .

Ns2 : The tcl files are used for network simulation.
Not pure tcl. Otcl is also used.
. http://otcl-tclcl.sourceforge.net/otcl/
. http://en.wikipedia.org/wiki/OTcl


← #1 .

May be you can let "1.tcl" generate a file (traffic file?),
.. which can be used by "2.tcl" ?


-
 
Old 12-10-2014, 02:28 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
P.S. :

@bayefalle :
Why are you posting in the "General discussions Forum" ?

You can use the `Report' button for asking a mod to move the thread to "Software".

General : ""This forum is for non-technical general discussion""


-

Last edited by knudfl; 12-10-2014 at 02:30 PM.
 
  


Reply

Tags
ns2



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to import a variable from C++ program to TCL script? THX haiying7 Linux - Software 4 09-24-2012 07:31 PM
[SOLVED] set environment variable is tcl sharky Programming 1 04-22-2011 04:51 PM
[SOLVED] How to : setting PATH variable for TCL raju.mopidevi SUSE / openSUSE 18 02-22-2009 11:14 AM
Two differents codes with two differents gcc ( 3.4 and 4.1) Tanc Programming 6 04-09-2008 12:57 PM
Imp for me: How to pass a variable from .tcl file to Makefile sun_sun Programming 6 11-27-2007 05:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:43 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