GETOPT(1) GETOPT(1) (NAME) getopt - (SYNOPSIS) getopt optstring parameters getopt [options] [--] optstring parameters getopt [options] -o|--options optstring [options] [--] parameters (DESCRIPTION) getopt () . getopt(3) (GNU) . getopt : getopt (options optstring ) (parameters ). '--' . '-o' '--options' . GETOPT_COMPATIBLE parameter ( '-' ) getopt getopt(1) . ( ). getopt(1) (whitespace) ( ) . (quoted) ( eval). getopt ( ). getopt(1) (-T) . (OPTIONS) -a, --alternative '-' . -l, --longoptions longopts () . ( ) . longopts . longopts (:) (::) . -n, --name progname getopt(3) . getopt(1) getopt . -o, --options shortopts () . getopt '-' ( ) . shortopts (:) (::) . shortopts '+' '-' ( ). -q, --quiet getopt(3). -Q, --quiet-output . getopt(3) -q . -s, --shell shell shell. -s BASH . : 'sh' 'bash' 'csh' 'tcsh'. -T, --test getopt(1) . (error status) 4 . getopt(1) GETOPT_COMPATIBLE '--' 0 . -u, --unquoted () . ( ) ( getopt(1) ). -U, --unknown getopt(3). . . -h, --help . -V, --version . (PARSING) getopt (parameters ) . () . . getopt ( ). getopt(3) . . . '-' ':' ';' '?' getopt(3) . ( ). . '-' ( ) . '--' . '=' ( ). '=' ( '=' ). . '-' . '--' . POSIXLY_CORRECT '+' . (OUTPUT) . . ( ) ( ). ( shift ). . stderr . '-' . . () . getopt(1) . '-' . '--' . '-' . . . '--' . '-' ( '-' '+' ). (QUOTING) <<>> . . (quoting) . . ( eval ) . GETOPT_COMPATIBLE '-u' . . '-s' . : 'sh' 'bash' 'csh' 'tcsh'. <<>> : sh csh. . (SCANNING MODES) '-' '+' . POSIXLY_CORRECT . '+' POSIXLY_CORRECT ( '-' ) . . '-' '--' . '--' . (COMPATIBILITY) getopt(1) . . getopt '-' getopt . . ( ) POSIXLY_CORRECT getopt '+' . GETOPT_COMPATIBLE getopt . POSIXLY_CORRECT <<>> . . '-' '+' . (RETURN CODES) getopt 0 1 getopt(3) 2 3 (out-of-memory) 4 -T . (EXAMPLES) (ba)sh (t)csh getopt(1) /usr/share/doc/util-linux . (ENVIRONMENT) POSIXLY_CORRECT getopt(3) . . '-' . GETOPT_COMPATIBLE getopt . (BUGS) getopt(3) ( ). getopt(1) . ( ). (AUTHOR) Frodo Looijaard (SEE ALSO) bash(1), tcsh(1), getopt(3) (REPORTING BUGS) . (AVAILABILITY) getopt util-linux . util-linux 2.42.3 2026-09-02 GETOPT(1)