RMGETOPTS

Section: User Commands (1)
Updated: July 16, 1993
Index Return to Main Contents
 

NAME

rmgetopts - remove getopts processing from shell script  

SYNOPSIS

rmgetopts [ file ]  

DESCRIPTION

rmgetopts reads a shell script that uses getopts(1) to process command options and converts it into one that does not. Input must have the following form:

... random shell code ...
while getopts optstr var
do
        ... more shell code ...
done
shift `expr $OPTIND - 1`
... still more shell code ...

rmgetopts is a ``dumb'' program that knows next to nothing about shell syntax; the following restriction must be observed for it to work properly.

*
The do must follow the while on a separate line.
*
No trailing comments are allowed on any of the while, do, done, or shift lines.
*
None of the while, do, done, or shift lines may have whitespace preceding the first keyword. All lines in between the do and done lines ought to be indented.
 

SEE ALSO

getopts(1), sh(1).  

BUGS

The resulting code process options rather slowly.  

AUTHOR

Michael S Zraly (mzraly@cs.umb.edu)


 

Index

NAME
SYNOPSIS
DESCRIPTION
SEE ALSO
BUGS
AUTHOR

This document was created by man2html, using the manual pages.
Time: 06:24:25 GMT, December 12, 2024