perl backticks: use bash instead of sh

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

    I thought perl would honor the $SHELL variable, but then it occurred to me that its behavior might actually depend on your system's exec implementation. In mine, it seems that exec

    will execute the shell (/bin/sh) with the path of the file as its first argument.

    You can always do qw/bash your-command/, no?

提交回复
热议问题