From unknown Tue Jun 17 01:41:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21672: env is not splitting command and argument as suggested by the synopsis Resent-From: Esli Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Mon, 12 Oct 2015 15:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 21672 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 21672@debbugs.gnu.org X-Debbugs-Original-To: Received: via spool by submit@debbugs.gnu.org id=B.144466372115885 (code B ref -1); Mon, 12 Oct 2015 15:29:01 +0000 Received: (at submit) by debbugs.gnu.org; 12 Oct 2015 15:28:41 +0000 Received: from localhost ([127.0.0.1]:37209 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zlf1k-000489-RU for submit@debbugs.gnu.org; Mon, 12 Oct 2015 11:28:41 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40051) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZlYn2-0001SH-7s for submit@debbugs.gnu.org; Mon, 12 Oct 2015 04:49:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZlYn1-0003Uf-0j for submit@debbugs.gnu.org; Mon, 12 Oct 2015 04:49:03 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:53773) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlYn0-0003Ub-UA for submit@debbugs.gnu.org; Mon, 12 Oct 2015 04:49:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50051) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlYn0-0003Uz-1F for bug-coreutils@gnu.org; Mon, 12 Oct 2015 04:49:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZlYmx-0003SW-7u for bug-coreutils@gnu.org; Mon, 12 Oct 2015 04:49:01 -0400 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]:36593) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlYmx-0003SS-1v for bug-coreutils@gnu.org; Mon, 12 Oct 2015 04:48:59 -0400 Received: by wicgb1 with SMTP id gb1so139909979wic.1 for ; Mon, 12 Oct 2015 01:48:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type :thread-index:content-language; bh=9N/05YVPOgD8xSET4R6T3e/p27jfEo5LnkZPY/O6Bgs=; b=zAwPYCoh7eVUTZN9DIFQZwwQq6owmpotDntV+B29CsC+XTQxVKn4LxurFh2ViBBuhx 8eDsLc5/Ih47td8/jo51R6LcPuMJXVZ4WT/gC090c4/D9ikLzSGj4bUpybE1RGYsIBBp cNoSSLBwarluSQvMYzdYJMcSY2d4UcYTqVBJwUAzfYn8CvN/u22NeXN0jMEBtZ7vBqCo ie8EolnZV556dwYdDavwIEqw6B9546R++GyUP2ojulylCoJQNYBQsZEd623SEDI2NfHy xirmfXBfZ3/2QLEe4118EFM7XkTx3sXibvg4F0RlE0X+JWCZXPYDxGxtSsE/57fhXgEe uAJA== X-Received: by 10.194.90.168 with SMTP id bx8mr8225401wjb.0.1444639738206; Mon, 12 Oct 2015 01:48:58 -0700 (PDT) Received: from black (84.182.106.92.dynamic.wline.res.cust.swisscom.ch. [92.106.182.84]) by smtp.gmail.com with ESMTPSA id p18sm9958966wik.19.2015.10.12.01.48.57 for (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Oct 2015 01:48:57 -0700 (PDT) From: Esli X-Google-Original-From: "Esli" Date: Mon, 12 Oct 2015 10:48:55 +0200 Message-ID: <003301d104ca$d479ec00$7d6dc400$@gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0034_01D104DB.98052D00" X-Mailer: Microsoft Outlook 14.0 Thread-Index: AdEEytPymdlkH9dwTye8SRHRm0mR1w== Content-Language: en-gb X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Mailman-Approved-At: Mon, 12 Oct 2015 11:28:39 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) This is a multipart message in MIME format. ------=_NextPart_000_0034_01D104DB.98052D00 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello, env is not splitting command and argument as suggested by the synopsis: SYNOPSIS env [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...] Example: #!/usr/bin/env perl -w produces: /usr/bin/env: perl -w: No such file or directory Apparently, env is looking for command "perl -w", not for command "perl" and than passing him "-w" Regards Petr ------=_NextPart_000_0034_01D104DB.98052D00 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hello,

 

  env = is not splitting command and argument as suggested by the = synopsis:

SYNOPSIS

       env [OPTION]... = [-] [NAME=3DVALUE]... [COMMAND [ARG]...]

 

Example:

#!/usr/bin/env perl -w

produces:

/usr/bin/env: perl -w: No such file or = directory

 

Apparently, env is looking for command "perl = -w", not for command "perl" and than passing him = "-w"

 

Regards

   Petr

------=_NextPart_000_0034_01D104DB.98052D00-- From unknown Tue Jun 17 01:41:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21672: env is not splitting command and argument as suggested by the synopsis Resent-From: Davide Brini Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Mon, 12 Oct 2015 15:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21672 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 21672@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.144466416916656 (code B ref -1); Mon, 12 Oct 2015 15:37:01 +0000 Received: (at submit) by debbugs.gnu.org; 12 Oct 2015 15:36:09 +0000 Received: from localhost ([127.0.0.1]:37216 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zlf8z-0004Ka-GA for submit@debbugs.gnu.org; Mon, 12 Oct 2015 11:36:09 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50814) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zlf8x-0004KS-Cm for submit@debbugs.gnu.org; Mon, 12 Oct 2015 11:36:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zlf8w-0003Z6-7r for submit@debbugs.gnu.org; Mon, 12 Oct 2015 11:36:07 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:57818) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zlf8v-0003Z2-Tj for submit@debbugs.gnu.org; Mon, 12 Oct 2015 11:36:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60800) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zlf8u-0008LT-WC for bug-coreutils@gnu.org; Mon, 12 Oct 2015 11:36:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zlf8s-0003XK-B7 for bug-coreutils@gnu.org; Mon, 12 Oct 2015 11:36:04 -0400 Received: from mout.gmx.net ([212.227.17.21]:56818) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zlf8s-0003WQ-3E for bug-coreutils@gnu.org; Mon, 12 Oct 2015 11:36:02 -0400 Received: from zoot.sax ([88.12.60.209]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0LiDHj-1aOJPo2Nl5-00nNIN for ; Mon, 12 Oct 2015 17:35:59 +0200 Date: Mon, 12 Oct 2015 17:35:56 +0200 From: Davide Brini In-Reply-To: <003301d104ca$d479ec00$7d6dc400$@gmail.com> References: <003301d104ca$d479ec00$7d6dc400$@gmail.com> X-Mailer: Claws Mail 3.13.0 (GTK+ 2.24.28; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID: <0MNqcR-1ZeE563fhb-007Syl@mail.gmx.com> X-Provags-ID: V03:K0:k1WsUdZhvJIaTpHS7odtJk8ul1s5pMkPP8GCVo78aX+kNMn91fs gvnNCizGBiRPHPQZ54m5uJQOvQb9bgq/C07YanTOYnzriu+qlfLZryqnjTsBRsTBT0QXaO4 DCb5XMcTYUX+vNrvR3D3rYmDCMxw5EPtC3RB7JzFKmbaqF1ZmY+hv8bQly18PSDLeGBlQXR Q9lp++jUqcLAi73XK79BA== X-UI-Out-Filterresults: notjunk:1;V01:K0:rB7k6QppH4c=:ayJNCZlqzUO0Pg/jSNVIoJ TUCYKigv8NHObc03XwXx/R1fBFlUoV9DPpLKcSyf0f8DOUEnSYBctg+ztsY4GzI/5kdu98SfF sHf/QmWbGYO/nLTTJxAZHn8R6LL5PYY0JwvOWqNL4SRoKxQXJxX27MtcJh6nUJbIP4EhTunVV aSelts8pUurjiqZf6su2lZvjJkSPnZHNVNuFBTa2+5nVZm8uTDtoUAhW9N2sOJ0/0ckwtqiWX qIYWi8ddF5t/CTb//R/76S0gg4jSbMclPPKZlm5GBTBSxxNxGnC37ueA5y8guMfLU1TZbIuMy 4pFS2sYS3GlwC5QD+6QH23/It4XwBYejTC7VZB/dhW0p1PcUFGeUBA0DWMA0TMLkg1kgl6iGS GCN0KUX1IjQT2jnlHRizoMJKbmkGiZoAtOvw2OGUoc96O/6wHNNZnvX8GxegIL9ex+PGJOdA5 ASQEAG8z4QLmobnT0pmfm3e+aaYtDHSTDTm/EiYu9IEECIydUaZRjQ3jYaUUy9d3VqWKdoM+2 IiUvP/7gTZexwgKv2gGrp4pf6rhenujGBU0k53IgC148S9GzudyPk/NhOcaFJBBg3FQ6cYI1f lz7zFnwCMrR+arJJ4itG1Ta7P6Wazszr7K0xfAYEWyFmFDUjpymK7463OTfH5ACsZto5CDor9 Gfau838bO6V6Wcw+N8uINbIpFzX08Y9CYCPbxweXwBbSlhEoGldMNhrnJC74/qm8ICwCu5J55 V150tEdcdFUaLCRQVhmlLmUpxrcJGnkvWXfHoXyA8ootPbopEcLX+/UcNIMVEsN0wj0deQBpQ n1vyN5q X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) On Mon, 12 Oct 2015 10:48:55 +0200, Esli wrote: > Hello, > > > > env is not splitting command and argument as suggested by the synopsis: > > SYNOPSIS > > env [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...] > > > > Example: > > #!/usr/bin/env perl -w > > produces: > > /usr/bin/env: perl -w: No such file or directory > > > > Apparently, env is looking for command "perl -w", not for command "perl" > and than passing him "-w" This is due to how the shebang works under Linux, nothing to do with env, see this page for all the details: http://www.in-ulm.de/~mascheck/various/shebang/ -- D. From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 12 11:40:49 2015 Received: (at control) by debbugs.gnu.org; 12 Oct 2015 15:40:49 +0000 Received: from localhost ([127.0.0.1]:37223 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZlfDV-0004RA-35 for submit@debbugs.gnu.org; Mon, 12 Oct 2015 11:40:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50918) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZlfDQ-0004Qt-JZ; Mon, 12 Oct 2015 11:40:45 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 9B3778E71F; Mon, 12 Oct 2015 15:40:43 +0000 (UTC) Received: from [10.3.113.134] (ovpn-113-134.phx2.redhat.com [10.3.113.134]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t9CFegYY022292; Mon, 12 Oct 2015 11:40:43 -0400 Subject: Re: bug#21672: env is not splitting command and argument as suggested by the synopsis To: Esli , 21672-done@debbugs.gnu.org References: <003301d104ca$d479ec00$7d6dc400$@gmail.com> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg X-Enigmail-Draft-Status: N1110 Organization: Red Hat, Inc. Message-ID: <561BD475.2090005@redhat.com> Date: Mon, 12 Oct 2015 09:40:37 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <003301d104ca$d479ec00$7d6dc400$@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1iJdJilALOcc0EEqppGllg4O7crV0fTqw" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --1iJdJilALOcc0EEqppGllg4O7crV0fTqw Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable tag 21672 notabug thanks On 10/12/2015 02:48 AM, Esli wrote: > Hello, >=20 > =20 >=20 > env is not splitting command and argument as suggested by the synopsi= s: Thanks for the report. However, this is a misunderstanding on your part on how the kernel implements #! on your system, and has nothing to do with env. The same would happen for any other attempt you make on your system to write a shebang line with more than one set of space separation= s. In short, shebangs differ tremendously across systems in how they behave, and so the common subset that you can portably rely on is severely limited in what it can do. > #!/usr/bin/env perl -w >=20 > produces: >=20 > /usr/bin/env: perl -w: No such file or directory That's because on your system, #! magic supports exactly ONE argument, whitespace included, and does NOT break it into words in the same way the shell does. So your kernel is invoking '/usr/bin/env' 'perl -w', and env is blindly trying to execute 'perl -w' (which does not exist), exactly as requested. But it is not env's job to do word splitting. You cannot mix /usr/bin/env PROG and options to PROG in the same #! shebang. It is not portable. But it is a limitation of your system, and not something env can work around. If you were to use '#!/path/to/perl -w', then your kernel would attempt to invoke '/path/to/perl' '-w'. The trick for this is then determining at installation time what to place in the file for /path/to/perl, since there is no canonical location for perl across all systems. Also, the perl documentation includes some hints on how to use /usr/bin/env perl as the shebang line, and then, separate from that line, enable options that you can't portably include in the shebang. But as this is not the perl mailing list, and I'm not the expert in it, I'm not going to go trying to find that documentation right now. Therefore, I'm closing this as not a coreutils bug, although you should feel free to add further comments on the topic as desired. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --1iJdJilALOcc0EEqppGllg4O7crV0fTqw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWG9R2AAoJEKeha0olJ0Nq9HkH/09ssSKxzlclIiH6bPUL9+if kejaiKPbPahaNlfgTHnkKLKs0ZawGOCRTLQMH54EHKQQsWqhkGEvc4hxg3Uv83NH UQeaHwAPyGgDuRerwoDfhsZAcYmR8/nkkTnDcdJ+ZNJfO4Tubg5yf0P13tk45UeH w2qjgX+/uoapLXjPnhXPxVDBbIoTjTe9HGA7YEJpxKxudAtZ6VFb2AbkX0VdJWug 8AouY+f+3R8YXEvH4LXutYLN8YRYeQp+sG50HtQs6IyH+VpyRBdwqX21R1t28ee3 lje/6aqVFkiig8EWhfZnUJv7epzVQbdtcGDglbYDyL2qo00RvvNMVKB5ys4/hZQ= =0V/H -----END PGP SIGNATURE----- --1iJdJilALOcc0EEqppGllg4O7crV0fTqw-- From unknown Tue Jun 17 01:41:54 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Esli Subject: bug#21672: closed (Re: bug#21672: env is not splitting command and argument as suggested by the synopsis) Message-ID: References: <561BD475.2090005@redhat.com> <003301d104ca$d479ec00$7d6dc400$@gmail.com> X-Gnu-PR-Message: they-closed 21672 X-Gnu-PR-Package: coreutils X-Gnu-PR-Keywords: notabug Reply-To: 21672@debbugs.gnu.org Date: Mon, 12 Oct 2015 15:41:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1444664463-17106-1" This is a multi-part message in MIME format... ------------=_1444664463-17106-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #21672: env is not splitting command and argument as suggested by the synop= sis which was filed against the coreutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 21672@debbugs.gnu.org. --=20 21672: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D21672 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1444664463-17106-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 21672-done) by debbugs.gnu.org; 12 Oct 2015 15:40:49 +0000 Received: from localhost ([127.0.0.1]:37221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZlfDU-0004R7-CC for submit@debbugs.gnu.org; Mon, 12 Oct 2015 11:40:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50918) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZlfDQ-0004Qt-JZ; Mon, 12 Oct 2015 11:40:45 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 9B3778E71F; Mon, 12 Oct 2015 15:40:43 +0000 (UTC) Received: from [10.3.113.134] (ovpn-113-134.phx2.redhat.com [10.3.113.134]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t9CFegYY022292; Mon, 12 Oct 2015 11:40:43 -0400 Subject: Re: bug#21672: env is not splitting command and argument as suggested by the synopsis To: Esli , 21672-done@debbugs.gnu.org References: <003301d104ca$d479ec00$7d6dc400$@gmail.com> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg X-Enigmail-Draft-Status: N1110 Organization: Red Hat, Inc. Message-ID: <561BD475.2090005@redhat.com> Date: Mon, 12 Oct 2015 09:40:37 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <003301d104ca$d479ec00$7d6dc400$@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1iJdJilALOcc0EEqppGllg4O7crV0fTqw" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 21672-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --1iJdJilALOcc0EEqppGllg4O7crV0fTqw Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable tag 21672 notabug thanks On 10/12/2015 02:48 AM, Esli wrote: > Hello, >=20 > =20 >=20 > env is not splitting command and argument as suggested by the synopsi= s: Thanks for the report. However, this is a misunderstanding on your part on how the kernel implements #! on your system, and has nothing to do with env. The same would happen for any other attempt you make on your system to write a shebang line with more than one set of space separation= s. In short, shebangs differ tremendously across systems in how they behave, and so the common subset that you can portably rely on is severely limited in what it can do. > #!/usr/bin/env perl -w >=20 > produces: >=20 > /usr/bin/env: perl -w: No such file or directory That's because on your system, #! magic supports exactly ONE argument, whitespace included, and does NOT break it into words in the same way the shell does. So your kernel is invoking '/usr/bin/env' 'perl -w', and env is blindly trying to execute 'perl -w' (which does not exist), exactly as requested. But it is not env's job to do word splitting. You cannot mix /usr/bin/env PROG and options to PROG in the same #! shebang. It is not portable. But it is a limitation of your system, and not something env can work around. If you were to use '#!/path/to/perl -w', then your kernel would attempt to invoke '/path/to/perl' '-w'. The trick for this is then determining at installation time what to place in the file for /path/to/perl, since there is no canonical location for perl across all systems. Also, the perl documentation includes some hints on how to use /usr/bin/env perl as the shebang line, and then, separate from that line, enable options that you can't portably include in the shebang. But as this is not the perl mailing list, and I'm not the expert in it, I'm not going to go trying to find that documentation right now. Therefore, I'm closing this as not a coreutils bug, although you should feel free to add further comments on the topic as desired. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --1iJdJilALOcc0EEqppGllg4O7crV0fTqw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWG9R2AAoJEKeha0olJ0Nq9HkH/09ssSKxzlclIiH6bPUL9+if kejaiKPbPahaNlfgTHnkKLKs0ZawGOCRTLQMH54EHKQQsWqhkGEvc4hxg3Uv83NH UQeaHwAPyGgDuRerwoDfhsZAcYmR8/nkkTnDcdJ+ZNJfO4Tubg5yf0P13tk45UeH w2qjgX+/uoapLXjPnhXPxVDBbIoTjTe9HGA7YEJpxKxudAtZ6VFb2AbkX0VdJWug 8AouY+f+3R8YXEvH4LXutYLN8YRYeQp+sG50HtQs6IyH+VpyRBdwqX21R1t28ee3 lje/6aqVFkiig8EWhfZnUJv7epzVQbdtcGDglbYDyL2qo00RvvNMVKB5ys4/hZQ= =0V/H -----END PGP SIGNATURE----- --1iJdJilALOcc0EEqppGllg4O7crV0fTqw-- ------------=_1444664463-17106-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 12 Oct 2015 15:28:41 +0000 Received: from localhost ([127.0.0.1]:37209 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zlf1k-000489-RU for submit@debbugs.gnu.org; Mon, 12 Oct 2015 11:28:41 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40051) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZlYn2-0001SH-7s for submit@debbugs.gnu.org; Mon, 12 Oct 2015 04:49:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZlYn1-0003Uf-0j for submit@debbugs.gnu.org; Mon, 12 Oct 2015 04:49:03 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:53773) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlYn0-0003Ub-UA for submit@debbugs.gnu.org; Mon, 12 Oct 2015 04:49:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50051) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlYn0-0003Uz-1F for bug-coreutils@gnu.org; Mon, 12 Oct 2015 04:49:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZlYmx-0003SW-7u for bug-coreutils@gnu.org; Mon, 12 Oct 2015 04:49:01 -0400 Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]:36593) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZlYmx-0003SS-1v for bug-coreutils@gnu.org; Mon, 12 Oct 2015 04:48:59 -0400 Received: by wicgb1 with SMTP id gb1so139909979wic.1 for ; Mon, 12 Oct 2015 01:48:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type :thread-index:content-language; bh=9N/05YVPOgD8xSET4R6T3e/p27jfEo5LnkZPY/O6Bgs=; b=zAwPYCoh7eVUTZN9DIFQZwwQq6owmpotDntV+B29CsC+XTQxVKn4LxurFh2ViBBuhx 8eDsLc5/Ih47td8/jo51R6LcPuMJXVZ4WT/gC090c4/D9ikLzSGj4bUpybE1RGYsIBBp cNoSSLBwarluSQvMYzdYJMcSY2d4UcYTqVBJwUAzfYn8CvN/u22NeXN0jMEBtZ7vBqCo ie8EolnZV556dwYdDavwIEqw6B9546R++GyUP2ojulylCoJQNYBQsZEd623SEDI2NfHy xirmfXBfZ3/2QLEe4118EFM7XkTx3sXibvg4F0RlE0X+JWCZXPYDxGxtSsE/57fhXgEe uAJA== X-Received: by 10.194.90.168 with SMTP id bx8mr8225401wjb.0.1444639738206; Mon, 12 Oct 2015 01:48:58 -0700 (PDT) Received: from black (84.182.106.92.dynamic.wline.res.cust.swisscom.ch. [92.106.182.84]) by smtp.gmail.com with ESMTPSA id p18sm9958966wik.19.2015.10.12.01.48.57 for (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Oct 2015 01:48:57 -0700 (PDT) From: Esli X-Google-Original-From: "Esli" To: Subject: env is not splitting command and argument as suggested by the synopsis Date: Mon, 12 Oct 2015 10:48:55 +0200 Message-ID: <003301d104ca$d479ec00$7d6dc400$@gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0034_01D104DB.98052D00" X-Mailer: Microsoft Outlook 14.0 Thread-Index: AdEEytPymdlkH9dwTye8SRHRm0mR1w== Content-Language: en-gb X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 12 Oct 2015 11:28:39 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) This is a multipart message in MIME format. ------=_NextPart_000_0034_01D104DB.98052D00 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello, env is not splitting command and argument as suggested by the synopsis: SYNOPSIS env [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...] Example: #!/usr/bin/env perl -w produces: /usr/bin/env: perl -w: No such file or directory Apparently, env is looking for command "perl -w", not for command "perl" and than passing him "-w" Regards Petr ------=_NextPart_000_0034_01D104DB.98052D00 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hello,

 

  env = is not splitting command and argument as suggested by the = synopsis:

SYNOPSIS

       env [OPTION]... = [-] [NAME=3DVALUE]... [COMMAND [ARG]...]

 

Example:

#!/usr/bin/env perl -w

produces:

/usr/bin/env: perl -w: No such file or = directory

 

Apparently, env is looking for command "perl = -w", not for command "perl" and than passing him = "-w"

 

Regards

   Petr

------=_NextPart_000_0034_01D104DB.98052D00-- ------------=_1444664463-17106-1--