[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Нужен ли bash



 AC>> для getopt(3). Тебе привели хороших два примера.

 AC>> 1) transport [OPTIONS] remote_host remote_cmd [remote_cmd args.]
 AC>> 2) compare [OPTIONS] file1 <OP> file2

 AC>> Неужели этого недостаточно?

> Справедливости ради, я приводил контрпример не к getopt в линуксе
А это уже не имеет никакого значения, отличный пример.

> (он как раз с шансами отработает правильно
Нет. Не отработает. Смотри мой пример, декларацию getopt

int getopt(int argc, char * const argv[], const char *optstring);
                          ^^^^^^^
и getopt(3):
       ...
       By default, getopt() permutes the contents of argv as it scans,
       so that eventually all the non-options are at the end.

-- 
Best regards, Aleksey Cheusov.


Reply to: