Re: Нужен ли bash
- To: debian-russian@lists.debian.org
- Subject: Re: Нужен ли bash
- From: Andrey Kiselev <dron@ak4719.spb.edu>
- Date: Wed, 1 Oct 2008 10:17:23 +0400
- Message-id: <[🔎] 20081001061723.GA30504@ak4719.spb.edu>
- Mail-followup-to: debian-russian@lists.debian.org
- In-reply-to: <20080929112634.4d336953@ibem>
- References: <s938wtgjrfq.fsf@chel.imb.invention.com> <20080925152147.GA5674@nbw.dhome.lan> <s93prmr71ef.fsf@chel.imb.invention.com> <20080926100308.GY5674@nbw.dhome.lan> <s93od2b17so.fsf@chel.imb.invention.com> <20080926111749.GE5674@nbw.dhome.lan> <49150789@tigger.lan.cryptocom.ru> <20080926133358.GJ5674@nbw.dhome.lan> <13478627@tigger.lan.cryptocom.ru> <20080929112634.4d336953@ibem>
On Mon, Sep 29, 2008 at 11:26:34AM +0400, Grey Fenrir wrote:
> Не драки ради, а токмо для самообразования.
> Любопытно, как _негнутые_ утилиты обработают, скажем, файл с именем "-f"
> Как справится гнутая (<команда> <ключи> -- <файлы>) мне понятно, а
> какие есть инструменты для этого в стандарте?
Точно такие же.
The getopt() function shall return the next option character (if one is
found) from argv that matches a character in optstring, if there is one
that matches. If the option takes an argument, getopt() shall set the
variable optarg to point to the option-argument as follows:
1. If the option was the last character in the string pointed to by an
element of argv, then optarg shall contain the next element of
argv, and optind shall be incremented by 2. If the resulting value
of optind is greater than argc, this indicates a missing option-
argument, and getopt() shall return an error indication.
2. Otherwise, optarg shall point to the string following the option
character in that element of argv, and optind shall be incremented
by 1.
If, when getopt() is called:
argv[optind] is a null pointer*
argv[optind] is not the character -
argv[optind] points to the string "-"
getopt() shall return -1 without changing optind. If:
argv[optind] points to the string "--"
getopt() shall return -1 after incrementing optind.
--
Andrey V. Kiselev
ICQ# 26871517
Reply to: