You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
-
create code fences with backticks ` or tildes ~
```
like so
``` -
add language identifier to highlight code
```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible)
<https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. shell-script), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you
lang-bash
ls sec\*etmatchessec*etliterally. Any docs in POSIX or Bash mentioning this? As my first comment in the question, I still wonder if it is because variable versus plain pattern they undergo different expansions. This behaviour is too specific that I need more explanations. I afraid I might face other corner cases in the future.ls sec\*etdoesn't "match" anything, becausesec\*etis not a glob, so there's nothing to match. Again, try with failglob set and without a matching file, it will not complain. Here, the resulting argument tolsissec*etbecause the rules for unquoted words in the command line say that the backslash quotes the following character, it's exactly the same assec"*"et. I'm not sure why it's inconsistent that the backslash isn't discarded? It's not like the shell discards any other characters from values that result from expansions, either, right?*,?, and[. If one of these characters appears, and is not quoted, then the word is regarded as a pattern, and replaced with an alphabetically sorted list of filenames matching the pattern (see Pattern Matching)." (I expect escaping with a backslash counts as being quoted here, too, but I suppose you'll need to ask the maintainer if that's a question.)[*]works for what you want, being unquestionably a glob that only matches a literal asterisk, why not use that?