It works. I am reading the chapter about Shell Programming of "Learning the Korn Shell" from O'Reilly. I am trying out e.gs. However, they don't have the two lines:
xyz
exit 0
Although the problem is solved, I am wondering how come they would not have that. Is there any other way to "call" the function? I would appreciate it if you would let me know.
Typically, as in many "Learning" books, they are building
on past examples and it saves alot of paper if you don't keep
printing the "whole" program/script over and over. So...
you must call functions by name for them to be executed.
Just FYI, the "exit 0" statement is not necessary.
I just like including an exit code in case this shell script
is executed by some other shell script or program. This way,
you can determine the success or failure of the script by
its' exit code. For instance...
exit 0 - All is well
exit 255 - Huston... we've had a problem
The actual values are up to you but normally a "0" exit
code says everything is AOK.