Tcl script wont run in bash shell


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Tcl script wont run in bash shell
# 1  
Old 07-12-2010
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 doesn't recognise it. Also if I type the full name and enter, it doesn't run, it just says command not found.

When I bring up a terminal, it opens up in the bash shell. I think the script usually runs from the c shell. I can go over to the csh, but I think I may have issues then with environment variables not being set.

This is the top of my script

Code:
#!/bin/sh
#the next line restarts using tclsh \
exe tclsh "$0" "$@"
#
#

How do I get the terminal to start in csh (I thought csh was the "lowest shell it could start in). Also will I have to set a load of evironment varibles in hidden config files?

Thanks,
Ben.

Last edited by pludi; 07-12-2010 at 04:24 PM.. Reason: code tags, please...
# 2  
Old 07-13-2010
Hey sbsbg,

What's your Tcl script name?

PN.


Edit:
You have a syntax error in your script. It should look like (note that first command is exec):
Code:
#!/bin/sh
# the next line restarts using tclsh \
exec tclsh "$0" "$@"

# 3  
Old 07-13-2010
The script is called "Install".

Ben.
# 4  
Old 07-13-2010
What happens if you do:
Code:
./Install

PN
# 5  
Old 07-13-2010
Yea, sorry, the syntax in correct, I just trancribed it wrong. I couldn't cut and paste from my OpenSolaris VM.

The script definately works, it's been run many times on a Solaris box (which I didn't set up). I'm trying to see if I can get it to work on OpenSolaris, I think it's a problem with environment variables and running it from the bash shell.

Cheers,
Ben.
# 6  
Old 07-13-2010
Ok. If the script is right then either you don't have Tcl installed on your OpenSolaris box or you shell cannot find tclsh executable.

1. Try to check if you can run tclsh. Run tclsh command and you should get % prompt:

Code:
$ tclsh
% exit
$

2. If the above fails try to find if you have a tclsh on the machine:

Code:
$ find / -name tclsh -print 2>/dev/null
/usr/bin/tclsh
/opt/ActiveTcl-8.4/lib/tclx8.4/help/tcl/intro/tclsh
/opt/ActiveTcl-8.4/bin/tclsh
$

BR,
PN
# 7  
Old 07-13-2010
Hi,

Yea, it goes to the tclsh prompt when I type tclsh.

B.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to run ksh script in bash shell?

Hi All, I have few bash shell scripts which depends on one Ksh shell script. When i run bash shell scripts, it shows error as bad interpretor : ksh no such bad file or directory. When i tried to install ksh shell, it is not downloading too. If I remove !/bin/ksh command in starting line of the... (14 Replies)
Discussion started by: Karthik03
14 Replies

2. Shell Programming and Scripting

How to make a bash or shell script run as daemon?

Say i have a simple example: root@server # cat /root/scripts/test.sh while sleep 5 do echo "how are u mate" >> /root/scripts/test.log done root@server # Instead of using rc.local to start or another script to check status, I would like make it as daemon, where i can do the following: ... (2 Replies)
Discussion started by: timmywong
2 Replies

3. Shell Programming and Scripting

Shell script wont execute

Im using a script that writes a random line to a text file then executes another shell script. My problem is that the lottery shell script will not execute. Im not receiving an errors when running the shell script, and it copies a random line of text to mtest.txt fine. #!/bin/bash nscripts=2... (3 Replies)
Discussion started by: kylecn
3 Replies

4. Shell Programming and Scripting

How to run a bash script in csh shell?

Hi how to execute a bash script in csh shell? Thanks (3 Replies)
Discussion started by: rubinovito
3 Replies

5. Shell Programming and Scripting

Bash script wont exit?

Solved Stupidly I didn't put brackets around the , thanks for all the help guys if ps ax | grep Cluster__check.bash | grep -v grep > /dev/null -- fails (if ps ax | grep Cluster__check.bash | grep -v grep > /dev/null) --works (3 Replies)
Discussion started by: danmc
3 Replies

6. Shell Programming and Scripting

HOW to run a bash-code in a c-shell script ??

Is there a way to run some code in a C-shell script by different shell, like bash? I have that situation. I have prepared and perfectly workable bash-skript that now I have to execute under C-shell script, divide it on steps and without creating a new files (with the bash-code parts.) For... (6 Replies)
Discussion started by: alex_5161
6 Replies

7. Shell Programming and Scripting

script wont run

$ ls -l total 44 drwx------ 2 ivanachu users 512 Dec 6 19:15 VILEARN -rw------- 1 ivanachu users 74 Dec 5 18:42 cond -rwx------ 1 ivanachu users 97 Dec 5 21:30 cond2 -rwxrwxrwx 1 ivanachu users 4979 Feb 10 22:42 createHAqmgr.ksh -rw------- 1 ivanachu users 28 Dec 4... (10 Replies)
Discussion started by: ivanachukapawn
10 Replies

8. Shell Programming and Scripting

General Q: how to run/schedule a php script from cron jobs maybe via bash from shell?

Status quo is, within a web application, which is coded completely in php (not by me, I dont know php), I have to fill out several fields, and execute it manually by clicking the "go" button in my browser, several times a day. Thats because: The script itself pulls data (textfiles) from a... (3 Replies)
Discussion started by: lowmaster
3 Replies

9. Shell Programming and Scripting

script wont run from cron job

I have written a simple bash script that will run a wget command to recursively ftp an entire directories and it's contents. #!/bin/bash wget -r -N ftp://user:pass@server//VOL1/dir If I run from the regular command line it works fine. root@BUSRV: /media/backup1$ ./gwbu When I put it in... (1 Reply)
Discussion started by: mgmcelwee
1 Replies

10. Shell Programming and Scripting

why wont this script run?

i have this script i wrote, it chokes when running the add install client commandit keeps telling me the add_install_client command is incorrect. When I put the print statement in front of the command so it will echo it, the command looks right on the screen. Yes im am an ametuer, im trying to... (2 Replies)
Discussion started by: BG_JrAdmin
2 Replies
Login or Register to Ask a Question