bash script won't execute (Mac)

I can't get any bash scripts to run in Terminal (Mac - Snow Leopard). I have the following super-simple script, and I can't get it to execute despite having the correct permissions (I think).

#!/bin/bash

echo "WORK... PLEASE?!"

I named the file 'testScript.sh', and I added execution permissions via the following command:

chmod +x testScript.sh

The permissions look to be correct, but when I type "testScript.sh" I get that stupid

"-bash: testScript.sh: command not found"

message.

Any idea what I'm doing wrong?

./testScript.sh

Try

./testScript.sh

When you type a command, the shell looks in your path, which is a list of directories, for the location of the program. You can find your path by typing "echo $PATH", but it's usually something like /usr/local/bin, /usr/bin and /bin. In this case it didn't find the script in those locations. To run from the current directory, add the "./"

Otherwise,you can also run the script by following command.

sh testscript.sh

Ah... makes sense. Is there a way to change that (or would it be best to leave it alone)?

Thanks for all the quick responses. You guys/gals are awesome!

Depend on which default shell you use.

Add below line in your .profile

PATH=$PATH:.
export PATH

After that, you can run with filename directly.

You can use the following way also to run the bash script

. script_name.sh