Update the rest of the docs for path

This commit is contained in:
Fabian Homborg
2021-09-08 20:01:04 +02:00
parent 3a9c52cefa
commit af1050d83f
2 changed files with 16 additions and 2 deletions

View File

@@ -492,6 +492,20 @@ Unlike bash (by default), fish will not pass on the literal glob character if no
apt install "ncurses-*"
For more capable wildcards, see the :ref:`path <cmd-path>` builtin, that features the ``path expand`` and ``path match`` subcommands that have full-featured globs, including ``[a-z]`` character ranges (and sets), ``[[:alnum:]]`` character classes and ``?`` for single-character matches. An example::
# I want all photos I took in October to December 2019, but not the ".raw" versions
> path expand 'IMG_20191[012]*' | path match -v '*.raw'
IMG_20191002_154337675_HDR.jpg
IMG_20191002_193313306.png
IMG_20191102_195530400_HDR.gif
IMG_20191104_122747460_HDR.jpg
IMG_20191105_195601152 (1).jpg
IMG_20191201_195601152.jpg
# Okay, now delete them
> rm (path expand 'IMG_20191[012]*' | path match -v '*.raw')
.. _expand-variable:
Variable expansion