January 2001
Intermediate to advanced
480 pages
7h 22m
English
Let's make a Korn shell script out of the print Hello world command by putting it into a file like this:
$ print "print Hello world" >prhello
Before Korn shell scripts can be executed, they must be made executable by setting the execute and read bits with the chmod command:
$ chmod 755 prhello
or
$ chmod +rx prhello
Assuming that the current directory is in the search path $PATH, prhello can now be executed by simply invoking it by name:
$ prhello Hello world
Korn shell scripts can also be executed by invoking them as the first argument to ksh:
$ ksh prhello Hello world
Now we can use prhello like any other command. The output can be directed to a file:
$ prhello >p.out $ cat p.out Hello world
It can ...
Read now
Unlock full access