optarg, opterr, optind, optopt

variables used by the getopt() function 

Global Variables


SYNOPSIS

#include <unistd.h>

extern char *optarg;

extern int opterr;

extern int optind;

extern int optopt;


DESCRIPTION

The optarg, opterr, optind, and optopt variables are used by the getopt() function. optarg indicates an optional parameter to a command line option. opterr can be set to 0 to prevent getopt() from printing error messages. optind is the index of the next element of the argument list to be process, and optopt is the command line option last matched.

Programs should obtain these definitions by the inclusion of <unistd.h>. The practice of defining the variables in a program as

extern char *optarg;

(without including <unistd.h>) is unsupported.


CONFORMANCE

UNIX 98.


AVAILABILITY

MKS Toolkit for Professional Developers
MKS Toolkit for Enterprise Developers
MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
getopt()


MKS Toolkit 9.3 Documentation Build 6.