I keep reading about making sh scripts executable with #!/bin/sh on
the first line and chmod to executable. That works with all my system
scripts (rc, etc.) or my system would be DOA, no doubt. When I do it
in my home folder, however, running <script> gives "command not
found". I've only read about 5 sites telling you how to make shell
scripts executable, they all say the same thing, and they all don't
work. How did I get to be so special?

Steve

Steve,

This is a sort of 'don't shoot yourself in the foot' design. You
cannot run a script or binary simply by name if you're cwd is the
directory that contains that script or binary. IIRC, you can't cd /
usr/bin and run anything in /usr/bin without explicitly calling that
file with the ./ telling the system THIS ONE.

The reason for this is to prevent someone, a shady fellow, from
putting a shell script in, say, a shared directory called ls, and
making it executable, and have some similarly shady code such as: