Regarding "How to make a script as a command?

Hi unix_guru(s),

How to make a shell script into a normal unix command?.

I'm always using shell to run a script(like $ksh demo.ksh).

I don't want to use this ksh at all time.

The script sholud run if i am typing as "demo" instead of typing "ksh demo.ksh"

Please, give me that trick.

Rule 1.

make the script executable by

chmod +x script

Rule 2.

have the name of the interpretor in the first line of your script as follows

#!/bin/ksh

Do what porter suggested +

  1. Put the directory in which you keep the scripts in the default PATH
    and if you really want to execute it like $ demo not like $ demo.sh

  2. make an alias for it in .ksh_profile

alias demo='demo.sh'

all the best,
v

when the script is added to the $PATH
just renaming it would do
just ' checkProcess ' would do instead of ' checkProcess.ksh '

Make sure the she-bang line is added to the script