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

help with dash manual page needed



Hi,

Paul Gevers and I were trying to write a release notes entry on a breaking change in dash (not a change per se, but a bug in one of the code paths fixed), and I realised that unlike most of the cases, the corresponding part of the manual page is written in an extremely mechanistic but not human-friendly way. I tried to rewrite it myself, I tried involving ChatGPT, but to no avail.

I’m curious if someone here could suggest a better way to describe the following.

Thanks in advance :)

# Shell Patterns

A pattern consists of normal characters, which match themselves, and meta-characters.  The meta-characters are “!”, “*”, “?”, and “[”.  These characters lose their special meanings if they are quoted.  When command or variable substitution is performed and the dollar sign or back quotes are not double quoted, the value of the variable or the output of the command is scanned for these characters and they are turned into meta-characters.

An asterisk (“*”) matches any string of characters.  A question mark matches any single character.  A left bracket (“[”) introduces a character class.  The end of the character class is indicated by a (“]”); if the “]” is missing then the “[” matches a “[” rather than introducing a character class.  A character class matches any of the characters between the square brackets.  A range of characters may be specified using a minus sign.  The character class may be complemented by making an exclamation point the first character of the character class.

To include a “]” in a character class, make it the first character listed (after the “!”, if any).  To include a minus sign, make it the first or last character listed.

P.S. Please Cc me in your replies.

-- 
Cheers,
  Andrej


Reply to: