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

uncommon shell code

From
RWRobert Watson <robert.oo.watson@gmail.com>
Date
Sep 22, 2005, 14:32 UTC
Message-ID
<72499e3b05092207326abadd91@mail.gmail.com>
Hi,
I found the following shell code in git-tag.sh (and others):
while case "$#" in 0) break ;; esac
do
  ...
done
Why not use the straight forward code:
while test "$#" -ne 0
do
   ...
done
Are there any functional difference between them?
Robertoo
Next: Junio C Hamano
Message 1 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.