]> git.ipfire.org Git - people/ms/network.git/commitdiff
util: Parse command line correctly when running commands
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 23 Sep 2018 15:53:46 +0000 (17:53 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 23 Sep 2018 15:53:46 +0000 (17:53 +0200)
Before, empty arguments where just dropped

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/functions/functions.util

index 58afa938a7249deb33dccf83a2f117802537d53c..b7674238333e828c703d7f572450827f84405557 100644 (file)
@@ -532,11 +532,11 @@ cmd_quiet() {
 }
 
 cmd_exec() {
-       local cmd=$@
+       local cmd=( "$@" )
 
        log DEBUG "Exec'ing command: ${cmd}"
 
-       exec ${cmd}
+       exec "${cmd[@]}"
 
        log ERROR "Could not exec-ute: ${cmd}"
        exit ${EXIT_ERROR}