Skip to content

Commit

Permalink
Small improvements and more doc updates - 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo Saporetti Junior committed Dec 27, 2023
1 parent b7e0adb commit dc1ddca
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
1 change: 1 addition & 0 deletions bin/hhs-functions/bash/hhs-search.bash
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ if __hhs_has "python3"; then
echo ''
echo ' Notes: '
echo ' - <file_globs...>: Comma separated file globs. E.g: "*.txt,*.md,*.rtf"'
echo ' - If <file_globs> is not specified, it will assume "*.*"'
return 1
else
dir="${1}"
Expand Down
26 changes: 23 additions & 3 deletions docs/handbook/pages/functions/std-tools/search-related.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ Usage: __hhs_search_string <search_path> [options] <regex/string> [file_globs]

Notes:
- <file_globs...>: Comma separated file globs. E.g: "*.txt,*.md,*.rtf"
- If <file_globs> is not specified, it will assume "*.*"
```
##### **Purpose**
Expand All @@ -163,8 +164,27 @@ Search in files for strings matching the specified criteria recursively.
##### **Examples**
`__hhs_search_string /var/log 'apple' '*.log'`
**Output**
```bash
/var/log/com.apple.xpc.launchd/launchd.log:1:2023-12-27 16:40:17.298063 (gui/504 [100004]) <Warning>: denied lookup: name = com.apple.contactsd.persistence, requestor = imagent[859], error = 159: Sandbox restriction
/var/log/com.apple.xpc.launchd/launchd.log:2:2023-12-27 16:40:17.904750 (gui/504 [100004]) <Warning>: denied lookup: name = com.apple.audio.audiohald, flags = 0x9, requestor = Microsoft Teams[20877], error = 159: Sandbox restriction
```
`__hhs_search_string . 'timezone:' '*.yaml,*.yml'`
**Output**
```bash
./src/main/resources/application.yml:1:timezone: America/Los_Angeles
```
`__hhs_search_string . -r 'timezone: America/Sao_Paulo' 'timezone: America/Los_Angeles' '*.properties,*.yaml'`
**Output**
```bash
$ __hhs_search_string /var/log 'apple' '*.log'
$ __hhs_search_string . 'server.port' '*.properties,*.yaml'
$ __hhs_search_string -r 'server.port = 1234' . 'server.port *= *.*' '*.properties,*.yaml'
./src/main/resources/application.yml:1:timezone: America/Sao_Paulo
```

0 comments on commit dc1ddca

Please sign in to comment.