pls hlp: making .sh files executable

I've got a file named jdictd.sh containing the following:

--- begin file contents ---
#! /bin/csh
echo I\'m running!
java -cp jdictd.jar org.dict.server.JDictd data/dict.ini
# Use the following line instead if JRE 1.1 is used
# jre -cp jdictd.jar org.dict.server.JDictd data/dict.ini
---end file contents ---

The attributes are set as follows:
-rwxrwxrwx 1 ropers staff 198 Jul 28 22:02 jdictd.sh

I am trying to just execute the file by typing:

jdictd.sh

at the tcsh prompt and it doesn't work.
If I type:

tcsh jdictd.sh

it does work however.
Any ideas?

  • tried this w/ both tcsh and bash
  • running FreeBSD/Mach/Darwin/MacOSX on G3 PPC

What message do you get when the script doesn't work?

If it's 'jdictd.sh not found' it's probably down to the directory your in not being part of the paths defined in your profile.

You can execute it by typing . ./jdictd.sh , or add the directory to your profile or move jdictd.sh to a directory in your profile.

The reason it works when you type tcsh jdictd.sh is because you are starting a new shell to run jdictd.sh & this shell then looks in the directory you are in to find jdictd.sh

thanks - that worked :slight_smile: