Running tcl Files in C shell


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Running tcl Files in C shell
# 1  
Old 11-29-2012
RedHat Running tcl Files in C shell

hello,

debashish here.Can any body tell me, how to execute tcl files in a C shell. i am working in synopsys tool for synthesis work. plz help me out.SmilieSmilie
Code:
[hkommuru@vlsi8~ ]$ source /packages/synopsys/setup/create_dir_setup.tcl

[hkommuru@vlsi8~ ]$ source /packages/synopsys/setup/synopsys_setup.tcl
[/code]i want to execute this 2 scripts.But it shows command not found.

so how tcl will be executed in csh environment.Else what is the equivalent command/file for tcl in csh environment.i read from different place,tcl is executed in DC Shell which is available in ubuntu but not in REDHAT4.our servers are configured in REDHAT.So plz plz help me out.

Moderator's Comments:
Mod Comment Video tutorial on how to use code tags in The UNIX and Linux Forums.
Please use code tags next time for your code and data.

Last edited by DEBASHISH DASH; 11-29-2012 at 09:42 AM..
# 2  
Old 11-29-2012
Hi.

Use tclsh. For example:
Code:
#!/usr/bin/env csh

# @(#) s1	Demonstrate calling a tcl script.

# Infrastructure details, environment, commands for forum posts. 
# Uncomment setenv command to run script as external user.
# setenv PATH "/usr/local/bin:/usr/bin:/bin"
echo
setenv LC_ALL C ; setenv LANG C
echo "Environment: LC_ALL = $LC_ALL, LANG = $LANG"
echo "(Versions displayed with local utility version)"
sh -c "version >/dev/null 2>&1 && version '=o' csh tclsh"
echo

echo " Sample tcl code (usually has tclsh shebang):"
head tcl1

echo
echo " Results:"
tclsh tcl1

exit 0

producing:
Code:
% ./s1

Environment: LC_ALL = C, LANG = C
(Versions displayed with local utility version)
OS, ker|rel, machine: Linux, 2.6.26-2-amd64, x86_64
Distribution        : Debian GNU/Linux 5.0.8 (lenny) 
csh tcsh 6.14.00 (Astron) 2005-03-25 (x86_64-unknown-linux) options wide,nls,dl,al,kan,rh,nd,color,filec
tclsh 8.4

 Sample tcl code (usually has tclsh shebang):
set version [ info tclversion ]
set message " Hello, world from tclsh ($version), $auto_path"
puts stdout $message

 Results:
 Hello, world from tclsh (8.4), /usr/share/tcltk/tcl8.4 /usr/lib /usr/local/lib/tcltk /usr/local/share/tcltk /usr/lib/tcltk /usr/share/tcltk

Good luck with your experiments ... cheers, drl

ps - standard advice: avoid csh for scripting, use Bourne shell relatives, sh, bash, ksh, zsh
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cp not working in shell script but running perfectly from shell

Dear All, I have script. Dest="" IFS=' ' for translation in $(echo $MY_MAP) do t1=$(echo $translation | cut -d"=" -f1) t2=$(echo $translation | cut -d"=" -f2| cut -d"," -f1) if then Dest=$UNX/$u_product_path/$u_study_path/$UNXTR/$t2 break; ... (4 Replies)
Discussion started by: yadavricky
4 Replies

2. Shell Programming and Scripting

Shell file to run other shell files running jar files

Hi, I am trying to write a shell script that will go to another folder and run the script in that folder. The folder structure is kind of like this: /MainFolder/ |-> MainShellScript.sh | |-> Folder1/ |-----|-> script1.sh |-----|-> FileToRun1.jar | |-> Folder2/ |-----|-> script2.sh... (3 Replies)
Discussion started by: sleo
3 Replies

3. Shell Programming and Scripting

Running multiple files through shell script with a variable

Ok, so this question is probably much easier than I'm making it, and thus why I've spent almost 2 hours now on this :wall:. I'm trying to use a command that reads out specific data from a file and and saves it to another file. The code is only a few lines, and here it is below: #!/bin/csh ... (4 Replies)
Discussion started by: mysterionRises
4 Replies

4. Shell Programming and Scripting

Syntax error calling TCL script from shell script

hello everyone i am beginner on shell scripting .and i am working on my project work on ad hoc network i wrote a batch (.sh) to do a looping and execute a tcl script i wrote before in each iteration ..but i got this problem " syntax error near unexpected token `('... (1 Reply)
Discussion started by: marcoss90
1 Replies

5. UNIX for Dummies Questions & Answers

Tcl script wont run in bash shell

Hello I'm having a problem running a TCL script in my new OpenSolaris OS. When I go to the directory containing my script called 'Install' (using the gnome terminal), it doesn't seem to be able to find it even though it lists it i.e. if I type "Inst" and hit tab to complete the word, it... (11 Replies)
Discussion started by: sbsbg
11 Replies

6. Shell Programming and Scripting

Convert my shell script into expect/tcl

hi experts, how will i convert the first part of my script into expect or tcl since shell script cannot be embedded into expect script ? i have 100+ servers in my serverlist. how will i call or declare it in expect or tcl ? #!/usr/sbin/expect -f serverlist=`cat $1` for i in serverlist... (2 Replies)
Discussion started by: linuxgeek
2 Replies

7. Shell Programming and Scripting

Setting Variable in TCL to be understood by KSH Shell

Hi , I am having one TCL TK script , I am setting some variables in the GUI TK interface set DI 1 set MODELS_PATH /a/d/path but I want to make ksh shell understand the variables when I am running TK script I tried to do like this set a but it is not working ... (1 Reply)
Discussion started by: kshitij
1 Replies

8. Shell Programming and Scripting

Running Perl script in TCL script

Hi, experts, I wonder if anyone can help me up with this. Has been googling and reading several books but still come to no idea how this can be done. Well, it's like this. I have a bundle of codes developed in Perl. I need to do something like this: 1. perl script run using spawn 2. in... (3 Replies)
Discussion started by: dniz
3 Replies

9. Shell Programming and Scripting

shell script equivalent for tcl function

Hello, I need experts help in converting the below tcl function to korn shell function equivalent. proc lsNetMaskToBits {mask} { set dw ; # Top N bits set set dw 0x ; # Make sure it's hexadecimal, else XOR fails. puts "lsNetMaskToBits dw $dw" set dw ; # Complement => low 32-N bits... (1 Reply)
Discussion started by: JackMelson
1 Replies

10. Solaris

Running from Shell Vs running from RC script

Hi, i have a script which need to do behave differently when run as a startup process from init.d/ rc2.d script and when run manually from shell. How do i distinguish whether my script is run by init process or by shell?? Will the command /proc/$$/psinfo | grep "myscript" work well???... (2 Replies)
Discussion started by: vickylife
2 Replies
Login or Register to Ask a Question