git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: uncommon shell code

From
Junio C Hamano <junkio@cox.net>
Date
Sep 23, 2005, 09:00 UTC
Message-ID
<7vwtl8duqj.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<72499e3b05092301322a145e52@mail.gmail.com>
Robert Watson <robert.oo.watson@gmail.com> writes:
> Well, it's fine now that I know what it is.  But it hurts
> readability, and probably it's a good idea to simplify it.

I try to stay away from style discussion, but readability is always relative and personal. Things like 'while case $# in ..." is an idiom for some but not for others -- and I am included in the former group of people (unfortunately). In any case, 'while test $# != 0' is not too much of a simplification anyway.

> Any reasonable shell should built-in test(1)?

Correct. The idiom comes from performance issues -- lack of built in test long ago -- and that issue is not relevant anymore. But the pattern being an idiom for some still is.

Having said that, I do not feel too strong about enforcing _my_ style. I _do_ feel somewhat strong about consistency, so if somebody wants to update them, without dropping the ball in the middle, it is very likely that I can be persuaded to take a series of patches to modernize them.

Previous: Robert Watson
Message 4 of 4 in “uncommon shell code”
  1. Robert WatsonSep 22, 2005
  2. Junio C HamanoSep 22, 2005
  3. Robert WatsonSep 23, 2005
  4. Junio C HamanoSep 23, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.