From 35c53a94b5b29e9d5142bb0574512d173f7b56b1 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Wed, 11 Aug 2021 18:42:21 +0200 Subject: [PATCH] docs: Remove stuff from globbing That `find` example is a bit dated and awkward, and doesn't really fit the section. We also don't want to point people to `?` because we want to remove it. --- doc_src/language.rst | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/doc_src/language.rst b/doc_src/language.rst index 6e9abd0c0..9764270b1 100644 --- a/doc_src/language.rst +++ b/doc_src/language.rst @@ -462,16 +462,6 @@ When a parameter includes an :ref:`unquoted ` ``*`` star (or "asterisk") - ``?`` can match any single character except ``/``. This is deprecated and can be disabled via the ``qmark-noglob`` :ref:`feature flag`, so ``?`` will just be an ordinary character. -Other shells, such as zsh, have a much richer glob syntax, like ``**(.)`` to only match regular files. Fish does not. Instead of reinventing the wheel, use programs like ``find`` to look for files. For example:: - - function ff --description 'Like ** but only returns plain files.' - # This also ignores .git directories. - find . \( -name .git -type d -prune \) -o -type f | \ - sed -n -e '/^\.\/\.git$/n' -e 's/^\.\///p' - end - -You would then use it in place of ``**`` like this, ``my_prog (ff)``, to pass only regular files in or below $PWD to ``my_prog``. [#]_ - Wildcard matches are sorted case insensitively. When sorting matches containing numbers, they are naturally sorted, so that the strings '1' '5' and '12' would be sorted like 1, 5, 12. Hidden files (where the name begins with a dot) are not considered when wildcarding unless the wildcard string has a dot in that place. @@ -480,8 +470,6 @@ Examples: - ``a*`` matches any files beginning with an 'a' in the current directory. -- ``???`` matches any file in the current directory whose name is exactly three characters long. - - ``**`` matches any files and directories in the current directory and all of its subdirectories. - ``~/.*`` matches all hidden files (also known as "dotfiles") and directories in your home directory.