In Perl, the default shell to execute backticks is sh. I'd like to switch to use bash for its richer syntax. So far I found that the suggested solution is
`bash -c \"echo a b\"`
The apparent drawback is that the escaped double quotes, which means I will have difficulty to use double quotes in my bash args. For example, if I wanted to run commands requiring double quotes in bash
echo "a'b"
The above method will be very awkward.
Perl's system() call has a solution for this problem: to use ARRAY args,
system("bash", "-c", qq(echo "a'b"));
This keeps my original bash command unmodified, and almost always.
I'd like to use ARRAY args in backticks too. Is it possible?