perl backticks: use bash instead of sh

前端 未结 6 1636
南笙
南笙 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:50

    Try

    `bash -c \"your command with args\"`
    

    I am fairly sure the argument of -c is interpreted the way bash interprets its command line. The trick is to protect it from sh - that's what quotes are for.

提交回复
热议问题