]> git.ipfire.org Git - people/ms/network.git/blobdiff - src/functions/functions.util
network fix parameter passing when using ""
[people/ms/network.git] / src / functions / functions.util
index 687d008f8f423f4e4d346325e6fc090f6f62869d..24e3e66b1682ed536722744a66a618af2f3f8d01 100644 (file)
@@ -134,7 +134,7 @@ parse_time() {
        local ret=0
 
        local arg
-       for arg in $@; do
+       for arg in "$@"; do
                local unit
 
                case "${arg}" in
@@ -495,7 +495,7 @@ cmd() {
 }
 
 cmd_quiet() {
-       cmd $@ &>/dev/null
+       cmd "$@" &>/dev/null
 }
 
 cmd_exec() {
@@ -515,7 +515,7 @@ cmd_not_implemented() {
 
 # Executes the given command in background
 cmd_background() {
-       cmd_quiet $@ &
+       cmd_quiet "$@" &
 }
 
 # Prints the PID of the process that was started last
@@ -531,7 +531,7 @@ cmd_background_result() {
 
 # Increase security of the read command
 read() {
-       builtin read -r $@
+       builtin read -r "$@"
 }
 
 seq() {
@@ -557,7 +557,7 @@ count() {
 }
 
 which() {
-       type -P $@
+       type -P "$@"
 }
 
 # Prints the number of seconds since epoch.