dash/ash
dash/ash
Posted Oct 3, 2014 9:48 UTC (Fri) by Jandar (subscriber, #85683)In reply to: dash/ash by nix
Parent article: Bash gets shellshocked
With arrays the construction of an argument-vector is easy.
typeset -a Options Files
Options+=("$option1")
Files+=("$file1")
$UseVerbose && Options+=("-v")
$UseSecondFile && Files+=("$file2")
command "${Options[@]}" -- "${Files[@]}"
How do you prepare (with correct quoting) a dynamic argument-vector without arrays? All other methods are ugly and error-prone beyond any acceptable limit.
