mirror of
https://github.com/Mastermindzh/examples.git
synced 2024-11-21 20:02:06 +01:00
find in glob, ignore glob added
This commit is contained in:
parent
037faf024e
commit
baf79376c8
@ -14,6 +14,7 @@ It also consolidates all relevant examples in 1 place
|
|||||||
```sh
|
```sh
|
||||||
.
|
.
|
||||||
├── bash
|
├── bash
|
||||||
|
│ ├── find-all-without.sh # find all files with glob (*) whilst ignoring another glob (*)
|
||||||
│ ├── parsing-command-line-params.sh
|
│ ├── parsing-command-line-params.sh
|
||||||
│ ├── remove-parentheses.sh # script to remove parentheses from all files in a directory (recursively)
|
│ ├── remove-parentheses.sh # script to remove parentheses from all files in a directory (recursively)
|
||||||
│ └── whiptail.sh # tiny demo of how whiptail works
|
│ └── whiptail.sh # tiny demo of how whiptail works
|
||||||
|
12
bash/find-all-without.sh
Normal file
12
bash/find-all-without.sh
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
## this script shows you how to find files matching a certain glob (*.csproj) but ignoring another glob (*.test.csproj)
|
||||||
|
|
||||||
|
CSPROJFILE=$(find . -iname '*.csproj' -a ! -iname '*test.csproj')
|
||||||
|
# ^ ^ ^ ^ ^ ^ ^
|
||||||
|
# assign var | | | | | |
|
||||||
|
# find | | | | |
|
||||||
|
# case insensitive search | | | |
|
||||||
|
# ending with *.csproj | | |
|
||||||
|
# logical and not | |
|
||||||
|
# case insensitive name search |
|
||||||
|
# ending with test.csproj
|
||||||
|
echo "$CSPROJFILE"
|
Loading…
Reference in New Issue
Block a user