diff --git a/src/prg/bash/agmaint.sh.in b/src/prg/bash/agmaint.sh.in index 62eaf15..99aadb4 100644 --- a/src/prg/bash/agmaint.sh.in +++ b/src/prg/bash/agmaint.sh.in @@ -82,6 +82,7 @@ # apt-get commands. # # 22/11/2021 MG 1.1.3 Tighten SPDX tag. # # 26/06/2023 MG 1.1.4 Fix shellcheck warnings. # +# 10/07/2023 MG 1.1.5 Treat cli_extra_args as an array. # # # ######################################################################### @@ -89,10 +90,10 @@ ################## # Init variables # ################## -readonly version=1.1.4 # Script version +readonly version=1.1.5 # Script version readonly packageversion=@pkgversion@ # Package version -cli_extra_args="" +cli_extra_args=() ############# @@ -202,7 +203,7 @@ proc_CL() # bash concatenates with a space, fine for later word splitting # on command line. # shellcheck disable=SC2124 - cli_extra_args=$@ + cli_extra_args=( "$@" ) fi } @@ -213,26 +214,22 @@ proc_CL() proc_CL "$@" -# shellcheck disable=SC2086 # Word splitting on space is required. -apt-get $cli_extra_args upgrade +apt-get "${cli_extra_args[@]}" upgrade status=$? output "apt-get upgrade completed with exit code: "$status $status std_cmd_err_handler $status -# shellcheck disable=SC2086 # Word splitting on space is required. -apt-get $cli_extra_args autoclean +apt-get "${cli_extra_args[@]}" autoclean status=$? output "apt-get autoclean completed with exit code: "$status $status std_cmd_err_handler $status -# shellcheck disable=SC2086 # Word splitting on space is required. -apt-get $cli_extra_args check +apt-get "${cli_extra_args[@]}" check status=$? output "apt-get check completed with exit code: "$status $status std_cmd_err_handler $status -# shellcheck disable=SC2086 # Word splitting on space is required. -apt-get $cli_extra_args autoremove +apt-get "${cli_extra_args[@]}" autoremove status=$? output "apt-get autoremove completed with exit code: "$status $status std_cmd_err_handler $status