On 18/04/18 17:18, William Schmidt wrote: > I think I've found a bug in *coreutils*, *env*. > > Linux debian 4.9.0-4-amd64 #1 SMP Debian 4.9.65-3+deb9u1 (2017-12-23) > x86_64 GNU/Linux > > All my Perl scripts contain either of these shebangs: > > #!/usr/bin/env perl -w > or > #!/usr/bin/env perl -wd > > When I attempt to run a Perl script with either of these shebangs in debian > I get: > > /usr/bin/env: ‘perl -w’: No such file or directory > > It is not perl that can't be found; it is either *env*'s or *bash*'s > handling of the argument. If I remove the *-w* and/or the *-wd* arguments > the scripts execute, but of course, without the benefit of those switches. > > The man page for *env* asserts that any command may take an argument. I > have tried every way I can think of to quote the *-w* and the *-wd* but > *env* is treating these perl command line arguments as filenames, and since > they aren't files, renders that error message. I'm running the latest > *coreutils* as in this apt-get fragment: > > Reading package lists... Done > Building dependency tree > Reading state information... Done > coreutils is already the newest version (8.26-3). > > Both of these shebangs work correctly in macOS 10.13.3 with the native perl > from Apple and perlbrew perl. That is where I do most of my perl work but > now I need to move those scripts to debian, without changing the shebangs. > Is this a bug in *env*, something in bash or pilot error?
The kernel passes "perl -w" to env as a single argument. This was previous discussed at: https://lists.gnu.org/archive/html/coreutils/2017-05/msg00020.html We may add the -S option to support this usage. cheers, Pádraig
