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

Re: [PATCH] CodingGuidelines: Fix a typo

From
Štěpán Němec <stepnem@gmail.com>
Date
Oct 9, 2010, 17:35 UTC
Message-ID
<87y6a7s20i.fsf@gmail.com>
In-Reply-To
<20101009152758.GA17799@burratino>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 12 quoted lines
> stepnem@gmail.com wrote:
>
>> `${parameter/pattern/string}' shell expansion uses glob patterns, so
>> talking about `regexp' is confusing.
>
> Okay.
>
>> - - No regexp ${parameter/pattern/string}.
>> + - No substitution ${parameter/pattern/string}.
>
> A bit confusing, since ${parameter%word} and $parameter are
> substitutions, too.

Not really. They are all parameter expansions. The former a "pattern removal", the latter a plain expansion (yeah I know you can _call_ it a substitution anyway, but I assume you were trying to be precise/match the Bash manual wording here).

But I agree "pattern substitution" is even clearer, thanks.

BTW, when we continue on this slightly bike-shedding note, it would make sense to unify the capitalisation of those termini technici in there ("Arithmetic Expansion", "Process Substitution"). Personally I would prefer having them all in lower-case; it feels a bit funny to read "We use Arithmetic Expansion". WDYT?

I hope the whitespace goes through undisturbed this time:
--- 8< ---
Subject: CodingGuidelines: Fix a typo
    `${parameter/pattern/string}' shell expansion uses glob patterns, so
    talking about `regexp' is confusing.
Signed-off-by: Štěpán Němec <stepnem@gmail.com>
---
 Documentation/CodingGuidelines |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index 8346c19..e52474b 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -53,7 +53,7 @@ For shell scripts specifically (not exhaustive):

  - No strlen ${#parameter}.

- - No regexp ${parameter/pattern/string}.
+ - No pattern substitution ${parameter/pattern/string}.

  - We do not use Process Substitution <(list) or >(list).

--
Previous: Jonathan NiederNext: Junio C Hamano
Message 3 of 5 in “CodingGuidelines: Fix a typo”
  1. CodingGuidelines: Fix a typostepnem@gmail.com, Oct 9, 2010
  2. Jonathan NiederOct 9, 2010
  3. Štěpán NěmecOct 9, 2010
  4. Junio C HamanoOct 9, 2010
  5. Jonathan NiederOct 11, 2010

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.