Unix Category

All UxOra articles related to Unix and Linux operating system and Shell Script will be published under this category.

User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active

In recent Korn Shell ksh93, getopts can be more powerful than you think, it can :

  • naturally parse short and long options with error management
  • manage option value as optional, as mandatory or as numeric
  • auto generate man page alike

This article will show how to use getopts in recent ksh93. If you have older ksh, read this other article instead.

(foobar_getopts.ksh zip file attachement in this article)

User Rating: 4 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Inactive

It's sometimes painful to create a shell script from scratch ...

So here is a script template that can help to start any good shell script.

This template contains header which is use for usage info as well, useful predefined functions and predefined variables, and manage short and long options.

(template.sh zip file is attached in this article)