Minimal example:
f="/tmp/a file"
cmd="cat \"$f\""
set -x
$cmd
How do I correctly handle $f
here such that cmd becomes cat "/tmp/a file"
(double or single quote).
cmd="cat '$f'"
also doesn't work.
Minimal example:
f="/tmp/a file"
cmd="cat \"$f\""
set -x
$cmd
How do I correctly handle $f
here such that cmd becomes cat "/tmp/a file"
(double or single quote).
cmd="cat '$f'"
also doesn't work.