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.:confused::wall:

[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.

Hi.

Use tclsh. For example:

#!/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:

% ./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