script file naming conventions & behaviour from gui
I'm accustomed to writing legit cli programs in xcode, but I occasionally just want to slap down a few lines of shell script and make it executable. I'm wondering what filename extension(s) to use and, (since I'm used to shell commands, but new to script files), what else there is to know. I've read that with, say, ...sh scripts, in addition to an appropriate hashbang in the script, '.sh' would be an appropriate file-name extension. I've seen and tried using 'foo.command' though and can then run the script by double-clicking it as well as typing its path from a shell. Is '.command' really an OS X thing? Are there other tricks I should know or things to be careful about? Also, is there any way to run (non-interactive) shell scripts from Finder without them launching terminal?
Any links or straight advice appreciated. Thanks in advance.
Mac: Too Many To List, Mac OS X (10.4.3), Pretty much one of everything Apple sells