Preserve command argument boundaries
Build a command with an indexed array and forward its original exit status.
Commands are arrays of arguments
A shell command is not just a string. It has a program name and a sequence of separate arguments. When you assemble that sequence as text and evaluate it again, spaces, glob patterns and command substitutions can acquire meaning you did not intend. A filename becomes especially dangerous if it is mistaken for shell source.
Bash indexed arrays preserve each boundary. Put the executable and fixed options into an array, then append quoted values and the quoted positional-argument array. Expanding the result with "${command[@]}" passes each element separately, including an empty argument. Quoting "${command[*]}" instead combines the elements into one string.
Keep the child's contract
The supplied helper prints the arguments it actually received. That makes invisible differences, such as a space inside one filename versus two filenames, observable. Its exit status is also part of the contract: a wrapper must not accidentally replace a failing status with a successful logging command.
The double dash is a conventional option terminator understood by this helper; it is not a universal shell operator. Use it only where the called program supports it. Reading a label with command substitution removes trailing newlines, which is appropriate for this lesson's one-line label file. It would be unsuitable for copying arbitrary file bytes unchanged. No eval or second parsing step is necessary.
values=('a file.txt' '*.log' '')
printf '<%s>\n' "${values[@]}"
Put it into practice.
Read the single-line label from label.txt. Invoke bash tools/describe.sh with arguments --label, the complete label as one value, --, then all main.sh arguments unchanged. With no main.sh arguments, use two defaults: records/東京 hosts.tsv and --literal. Use a Bash indexed command array. Let the script return the helper’s status. Do not execute shell-looking text in the label or arguments; preserve spaces, empty arguments, glob patterns and Unicode. command-status.txt supplies the helper’s test status.
See an explained solution
label=$(cat label.txt)
if [ "$#" -eq 0 ];then set -- 'records/東京 hosts.tsv' '--literal';fi
command=(bash tools/describe.sh --label "$label" -- "$@")
"${command[@]}"
The shell parses fixed source once, while supplied values remain individual arguments. The wrapper forwards both exact values and the child status, so callers can distinguish a successful description from a failed operation.