Как отправить по электронной почте машинописный текст сеанса терминала без необработанных данных?

Поскольку вы указываете bash в качестве используемой оболочки, введите:

$ help getopts

Что напечатает что-то вроде:

getopts: getopts optstring name [arg]
Parse option arguments.

Getopts is used by shell procedures to parse positional parameters as options.

OPTSTRING contains the option letters to be recognized; if a letter is followed by a colon, the option is expected to have an argument, which should be separated from it by white space.

Each time it is invoked, getopts will place the next option in the shell variable $name, initializing name if it does not exist, and the index of the next argument to be processed into the shell variable OPTIND. OPTIND is initialized to 1 each time the shell or a shell script is invoked. When an option requires an argument, getopts places that argument into the shell variable OPTARG.

Getopts normally parses the positional parameters ($0 - $9), but if more arguments are given, they are parsed instead.

Связанные:

  1. Учебник Getopts.
  2. getopts Как передать параметры командной строки
  3. Как использовать getopts в bash
  4. Getopt, getopts или разбор вручную?

2
21.07.2021, 07:59
0 ответов

Теги

Похожие вопросы