Variable containing multiple args with quotes in Bash

You might consider using an array for the args, something like this:

args=( "$f1" "$f2" )
ls "${args[@]}"

(The problem you’re hitting at the moment is that once interpolation has happened there’s no difference between intra- and inter- filename spaces.)

Leave a Comment