diff options
author | Süleyman Fərəcli <suleyman@farajli.net> | 2025-06-19 01:19:02 +0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-19 01:19:02 +0400 |
commit | 4d14ace3c5180ec0827408c1222cb35fe27cf484 (patch) | |
tree | 5e0caad138af71bdb2d9c524b0f6fff87eee4443 /scripts/slib | |
parent | 1eb90cf48629b8dfc0182cbe38b34c8082f4dc40 (diff) | |
parent | 4210338b4166f8f1c16bf30e72a69e11c098eea8 (diff) |
Merge pull request #9 from sfarajli/dev
Dev
Diffstat (limited to 'scripts/slib')
-rwxr-xr-x | scripts/slib | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/slib b/scripts/slib index 30e32ca..5ea05d6 100755 --- a/scripts/slib +++ b/scripts/slib @@ -15,7 +15,6 @@ argv0=$(basename "${0}") # @EXAMPLE: # err "Invalid usage" "Try '${argv0} -h' for help." - err() { if [ "${1}" != "-x" ]; then printf "%s: " "${argv0}" @@ -32,7 +31,7 @@ err() { # @FUNCTION: invalid_use # USAGE: [-h] # @DESCRIPTION: -# Output a usage error message. If `-h` is not specified output: +# Output a usage error message. If `-h` is not specified output: # "<program>: Invalid usage " # "Try 'program -h' for help." # else output only: @@ -72,6 +71,10 @@ check_program() { # To add a failure message a success message must also be present. # The output of the command is not suppressed. # +# This implementation does **not** use `eval`. Only simple commands and arguments are supported. +# Shell control operators like `&&`, `||`, pipes (`|`), or redirection (`>`, `>>`, etc.) will not work. +# This prevents unintended execution and makes it safe for use in scripts. +# # @EXAMPLE: # Run xwallpaper command if success print out ${image}: # |