From dc1ddcaf9736954a72402ca378d94327ff935bba Mon Sep 17 00:00:00 2001 From: Hugo Saporetti Junior Date: Wed, 27 Dec 2023 18:50:22 -0300 Subject: [PATCH] Small improvements and more doc updates - 2 --- bin/hhs-functions/bash/hhs-search.bash | 1 + .../functions/std-tools/search-related.md | 26 ++++++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/bin/hhs-functions/bash/hhs-search.bash b/bin/hhs-functions/bash/hhs-search.bash index 407bab9a..328d37f4 100644 --- a/bin/hhs-functions/bash/hhs-search.bash +++ b/bin/hhs-functions/bash/hhs-search.bash @@ -86,6 +86,7 @@ if __hhs_has "python3"; then echo '' echo ' Notes: ' echo ' - : Comma separated file globs. E.g: "*.txt,*.md,*.rtf"' + echo ' - If is not specified, it will assume "*.*"' return 1 else dir="${1}" diff --git a/docs/handbook/pages/functions/std-tools/search-related.md b/docs/handbook/pages/functions/std-tools/search-related.md index c28254c4..f3cc00e7 100644 --- a/docs/handbook/pages/functions/std-tools/search-related.md +++ b/docs/handbook/pages/functions/std-tools/search-related.md @@ -145,6 +145,7 @@ Usage: __hhs_search_string [options] [file_globs] Notes: - : Comma separated file globs. E.g: "*.txt,*.md,*.rtf" + - If is not specified, it will assume "*.*" ``` ##### **Purpose** @@ -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]) : 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]) : 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 ```