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
# 8  
Old 07-13-2010
That's good.

Stupid question - if you do ls in your directory.. what do you see?

PN
# 9  
Old 07-13-2010
If I type ls it lists all the scripts in the directory, including the Installs script.

I've made some progress. I created a .cshrc file in my home directory with the following contents copied off the solaris box (where the script works):

setenv run export/home/jack/run
source $run/case/scripts/Setup


I changed the run directory to match that on my open solaris VM. I then dumped out of the terminal and reloaded it (to source the .cshrc file). I then went from thr bash shell (which it starts in by default) to the c shell.
Now it recognises the script, but gives me the following error:

Code:
%Install
exec: tclsh: cannot execute [Exec format error]

Ben.
# 10  
Old 07-14-2010
Ben,

This is strange. Exec format error usually means that the executable was compiled for a different hardware architecture. Like you try to execute file compiled for x86 on SPARC.

Since you can start tclsh successfully and the Tcl script is nothing but a text file the problem should not be in Tcl itself.

1. If you have a chance to play with this box you can try to run install directly from tclsh with use of source command.

Code:
$ tclsh
% source Install
.. ....  whatever the install does

2. Your script uses Bourne shell anyway since it starts with #!/bin/sh so you may change .bash_profile to reflect the same changes you did for .cshrc

To answer you original question where can you switch default command interpreter from bash to csh it's in /etc/passwd file. It is the last parameter in your user record.

Cheers,
PN.
# 11  
Old 07-21-2010
Hello everyone, could it be related to a permissions issue?
I am on RHEL now and I see that, if a file has no execute permissions, it will not be auto-completed when pressing TAB.
touch filename generated filename with permissions 644 (RW-R--R--)
Changing the permissions to (e.g. 755, from 644, thus resulting in RWX-R-XR-X) allowed the file to be auto-completed when pressing TAB.
# 12  
Old 09-28-2010
PATH variable

Please make sure that current directory "./" is part of your $PATH variable which set in the ~/.profile file.
If it is not, then:
1) add it at the beginning of the $PATH
2) execute .profile (in order to new environment to take effect)
3) try to run your script again.
 
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