GETOPT(1) GETOPT(1) getopt - () getopt _ getopt [] [--] _ getopt [] -o|--options - [] [--] getopt () . GNU getopt(3). , getopt, : , getopt ( - ), , (- ). , , '--'. '-o' '--options' , . GETOPT_COMPATIBLE ( <<->>, ), getopt , getopt(1). ' (. , ). getopt(1) ( ) , . , , (, eval). , getopt , ( ). , getopt(1) , (-T). -a, --alternative <<->>. -l, --longoptions - The long (multi-character) options to be recognized. More than one option name may be specified at once, by separating the names with commas, whitespace (spaces, tabs, or newlines). This option may be given more than once, the longopts are cumulative. Each long option name in longopts may be followed by one colon to indicate it has a required argument, and by two colons to indicate it has an optional argument. -n, --name - , getopt(3) . , getopt(1) getopt. -o, --options - () , . , getopt, <<->> ( ). - , ' , , ' . - <<+>> <<->> , (. , ). -q, --quiet getopt(3). -Q, --quiet-output . getopt(3) , -q. -s, --shell . -s, BASH. <>, <>, <> <>. -T, --test , getopt(1) . 4. getopt(1) , GETOPT_COMPATIBLE, <<-->> 0. -u, --unquoted . , ( ) ( getopt(1)). -U, --unknown Leave unknown options as they are and suppress error messages from getopt(3). Since there is no way to know whether an unknown option requires an argument, a non-option argument that follows the unknown option after a whitespace, is considered an option argument, therefore the argument will be left untouched and printed next to the respective unknown option. To prevent unexpected behavior, short options should be specified individually. -h, --help . -V, --version . getopt (- ). () , . . , , , getopt (. ). GNU getopt(3). . , , . , <<->> , ':', ';' '?', getopt(3). ' , ( , ). ' , , . <<->>, (, , ) ' . , , <<-->>, . ' , <<=>> ( , ). ' , <<=>>, ( <<=>> , , ; , . ). , , . , <<->>, , . <<-->> . POSIXLY_CORRECT <<+>>, , . , . , , . () , , (. ). , , , ( (shift) ). , , . , , , ' , stderr , . <<->> . , . ' , , , , ( ). , getopt(1) ' . <<->>, . <<-->> , . , <<->> . , . , . <<-->> , , , . <<->>, , ( , ; <<->> <<+>> ). <<>> . , , . , . , . (, eval), . , GETOPT_COMPATIBLE, <<-u>>. . <<-s>> , . : <>, <>, <> <>. , <<>>: sh- csh- . , , . <<->> <<+>> . , ; , POSIXLY_CORRECT . <<+ POSIXLY_CORRECT, , ( , <<->>), . . <<->>, , ; , <<-->>. , <<-->> , . getopt(1) . , - . getopt <<->>, getopt . . . ( ), POSIXLY_CORRECT. , getopt <<+>> . GETOPT_COMPATIBLE getopt . POSIXLY_CORRECT <<>> . , . <<->> <<+>> . getopt 0 , 1, getopt(3) , 2, , 3, , ', 4, -T. (ba)sh (t)csh getopt(1), /usr/share/doc/util-linux. POSIXLY_CORRECT getopt(3). , , , . , , '-'. GETOPT_COMPATIBLE getopt , . getopt(3) ' , ' ( ). getopt(1) ' , , , . , , ( ). Frodo Looijaard bash(1), tcsh(1), getopt(3) getopt util-linux, Linux . util-linux 2.42.3 2026-09-02 GETOPT(1)