perl backticks: use bash instead of sh

前端 未结 6 1607
南笙
南笙 2021-01-05 11:20

I noticed that when I use backticks in perl the commands are executed using sh, not bash, giving me some problems.

How can I change that behavior so perl will use ba

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-05 11:58

    To deal with running bash and nested quotes, this article provides the best solution: How can I use bash syntax in Perl's system()?

    my @args = ( "bash", "-c", "diff <(ls -l) <(ls -al)" );
    system(@args);
    

提交回复
热议问题