Rules | Recent posts | topic RSS | Search | Register  | Log in

How to source a CSH file from inside a TCL script ?

 
Post new topic  Reply to topic    EDAboard.com Forum Index -> Linux Software
Author Message
omara007



Joined: 06 Jan 2003
Posts: 1149
Helped: 35
Location: Dubai


Post06 Aug 2008 15:44   How to source a CSH file from inside a TCL script ?

as in the topic
Back to top
gliss



Joined: 22 Apr 2005
Posts: 659
Helped: 61
Location: Boston Metro Area


Post06 Aug 2008 17:37   How to source a CSH file from inside a TCL script ?

You don't technically "source" CSH scripts from TCL scripts but you can use the 'exec' command in TCL to run CSH scripts or programs.
Back to top
omara007



Joined: 06 Jan 2003
Posts: 1149
Helped: 35
Location: Dubai


Post06 Aug 2008 19:57   Re: How to source a CSH file from inside a TCL script ?

gliss wrote:
You don't technically "source" CSH scripts from TCL scripts but you can use the 'exec' command in TCL to run CSH scripts or programs.


I have effectively tried 'exec' .. but unfortunately it didn't work with source as source is a shell-embedded command .. unlike 'mkdir' for example, which is a program under 'bin' ..

Did you try yourself doing that ? ..

In order to make my point clear, try to do (which mkdir) and (which source) to see the difference between a program like (mkdir) and a shell-embedded command like (source) ..
Back to top
gliss



Joined: 22 Apr 2005
Posts: 659
Helped: 61
Location: Boston Metro Area


Post06 Aug 2008 20:27   Re: How to source a CSH file from inside a TCL script ?

I still don't know why you need to run 'source'. Post your TCL code.
Back to top
omara007



Joined: 06 Jan 2003
Posts: 1149
Helped: 35
Location: Dubai


Post06 Aug 2008 22:07   Re: How to source a CSH file from inside a TCL script ?

gliss wrote:
I still don't know why you need to run 'source'. Post your TCL code.


I have 2 different CSH files .. according to the value of a certain variable (declared in a TCL script), I need to source only one CSH file .. but not the other ..

What is the problem with sourcing a file from inside a TCL script !
Back to top
gliss



Joined: 22 Apr 2005
Posts: 659
Helped: 61
Location: Boston Metro Area


Post07 Aug 2008 16:08   How to source a CSH file from inside a TCL script ?

you can source other TCL from within TCL scripts but you exec CSH scripts or other binary programs from within TCL scripts.
Back to top
omara007



Joined: 06 Jan 2003
Posts: 1149
Helped: 35
Location: Dubai


Post07 Aug 2008 17:11   Re: How to source a CSH file from inside a TCL script ?

gliss wrote:
you can source other TCL from within TCL scripts but you exec CSH scripts or other binary programs from within TCL scripts.


would you please give an example code for sourcing a csh script from inside a TCL script .. cuz I tried using this :

Code:
exec source xyz.csh


and it didn't work
Back to top
gliss



Joined: 22 Apr 2005
Posts: 659
Helped: 61
Location: Boston Metro Area


Post08 Aug 2008 15:37   Re: How to source a CSH file from inside a TCL script ?

Make sure xyz.csh is executable.

then do

Code:
exec xyz.csh


http://www.tcl.tk/man/tcl8.4/TclCmd/exec.htm
Back to top
omara007



Joined: 06 Jan 2003
Posts: 1149
Helped: 35
Location: Dubai


Post08 Aug 2008 16:32   Re: How to source a CSH file from inside a TCL script ?

gliss wrote:
Make sure xyz.csh is executable.

then do

Code:
exec xyz.csh


http://www.tcl.tk/man/tcl8.4/TclCmd/exec.htm



What do you mean by make sure it's executable ? .. the CSH file I have is simply a working csh script that I usually use with no problem thru my csh .. now, I need to invoke it from a TCL script .. that's it ..

I will try and let u know ..
Back to top
Post new topic  Reply to topic    EDAboard.com Forum Index -> Linux Software
Page 1 of 1 All times are GMT + 1 Hour


Abuse
Administrator
Moderators
topic RSS 
sitemap