Path: csiph.com!weretis.net!feeder8.news.weretis.net!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Phil Carmody Newsgroups: comp.lang.c,comp.unix.programmer Subject: Re: Piping to stdin Date: Mon, 14 Aug 2023 12:20:50 +0300 Organization: A noiseless patient Spider Lines: 40 Message-ID: <87o7ja3rpp.fsf@fatphil.org> References: <9e7a4bd1-bfbb-4df7-af1a-27ca9625e50bn@googlegroups.com> <87r0o6mqme.fsf@nosuchdomain.example.com> <20230813201038.114@kylheku.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Info: dont-email.me; posting-host="3b75e13a62fc21aed83b06f34f572f82"; logging-data="2375925"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX196saGomBbXorBPICbH5OTp" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cancel-Lock: sha1:85bZzy4QwAL2GB909AMhdKklb8I= sha1:EHUwRx5ER0Tz7YuBmWuyD5aRDQc= Xref: csiph.com comp.lang.c:172201 comp.unix.programmer:14313 Kaz Kylheku <864-117-4973@kylheku.com> writes: > On 2023-08-14, Kenny McCormack wrote: >> In article <87r0o6mqme.fsf@nosuchdomain.example.com>, >> Keith Thompson wrote: >>>scott@slp53.sl.home (Scott Lurndal) writes: >>>[...] >>>> Most programs in unix will accept '-?' or '-h' or some other flag >>>> to indicate that usage information is to be printed. Many utilities >>>> will print usage information if the input arguments are not valid. >>> >>>Most Unix programs don't use '-?' because '?' is a shell wildcard >>>character. If you happen to have files in the current directory named >>>"-x" and "-y", "myprogram -?" expands to "myprogram -x -y". >> >> Indeed - and this is one of the many reasons why insisting on an option >> (any option) to get help is a bad idea. Given that -? is kind of a >> standard in the Windows world, many programs that get ported over to >> Unix from Windows, will have this misfeature. > > Many command-line programs get ported to Unix from Windows? > > Why don't they adjust their conventions? > > /X /Y /Z /? is another convention; that one is smarter. > > The system installation can arrange for the first three not > to be paths, and for /? not to match anything due to there > not being a one-character item in the root dir. So if I want to grep case-insensitively for whole words, and have line numbers printed with the matched lines - in other words, on the unix version I'm doing ``grep -win ...'' - should my system installation arrange for /win to not be a path? Phil -- We are no longer hunters and nomads. No longer awed and frightened, as we have gained some understanding of the world in which we live. As such, we can cast aside childish remnants from the dawn of our civilization. -- NotSanguine on SoylentNews, after Eugen Weber in /The Western Tradition/