In addition to the PATH information given...
The source code for a shell program may have an extension; e.g.,
.sh or, in your case,
.ksh (although that's overkill). An executable shell program does not need nor should it particularly have an extension -- the standard in UNIX-based systems is that executable programs, AKA commands and utilities, just do not have an extension. The idea is that you develop source code, saving source code files with a given extension and then create the executable with the
make utility; e.g., if you have a file,
prog.sh and type
make prog the
make utility will copy
prog.sh to
prog then change mode of
prog to
755 with the command
chmod 755 prog. Then you can simply type
prog on the command line and hit the carriage return and
prog will execute.
If you look around the system, you will find that there are a large number of shell programs that you use constantly without even realizing that the utilities you're using are just... well, shell programs. You can see this by, for example
Code:
file /usr/bin/* | grep -i shell
(There should be 400+ and not a one of them has a
.sh extension).
Now, after all that, you can turn your
welcome.ksh into an executable program with
Code:
cp welcome.ksh welcome
chmod 755 welcome
and put
welcome on a PATH where everyone can get do it; e.g.,
/usr/local/bin or something similar (or as suggested above). You can't use
make to do this because
make doesn't know what
.ksh means (it does, however, know what to do with the standard
.sh extension).
And, last but not least, when you write a Korn shell program, be sure and make the first line of the file be
so that it will execute with the Korn shell rather than whatever shell a use is using.