From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 22 18:22:39 2016 Received: (at submit) by debbugs.gnu.org; 22 Jul 2016 22:22:39 +0000 Received: from localhost ([127.0.0.1]:34066 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQiq6-0008GP-HU for submit@debbugs.gnu.org; Fri, 22 Jul 2016 18:22:39 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56622) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQhF6-0005ql-0c for submit@debbugs.gnu.org; Fri, 22 Jul 2016 16:40:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQhF0-0003bq-00 for submit@debbugs.gnu.org; Fri, 22 Jul 2016 16:40:14 -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 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:33446) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQhEz-0003bG-Td for submit@debbugs.gnu.org; Fri, 22 Jul 2016 16:40:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQhEx-0003HV-M7 for bug-coreutils@gnu.org; Fri, 22 Jul 2016 16:40:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bQhEt-0003YW-FA for bug-coreutils@gnu.org; Fri, 22 Jul 2016 16:40:10 -0400 Received: from mx-aa.corefiling.com ([90.155.100.37]:57032 helo=mx.corefiling.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bQhEt-0003Uv-9G for bug-coreutils@gnu.org; Fri, 22 Jul 2016 16:40:07 -0400 Received: from router.int.corefiling.com ([10.0.0.1]:50350 helo=lahn.int.corefiling.com) by smtp.corefiling.com ([10.0.0.141]:587) with esmtpsa (ldap_plain:src) (TLSv1.2:DHE-RSA-AES128-SHA:128) id 1bQhEl-0007BK-6h (Exim 4.84) for bug-coreutils@gnu.org (return-path ); Fri, 22 Jul 2016 21:39:59 +0100 To: bug-coreutils@gnu.org From: Simon Richard Clarkstone Subject: Bug: #!/usr/bin/env gives poor error message for DOS line-endings Organization: CoreFiling Ltd Message-ID: <169e7463-532b-27b3-e4cf-c453993a5e9b@corefiling.com> Date: Fri, 22 Jul 2016 21:39:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SystemFilter-Debug: corefiling.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 22 Jul 2016 18:22:37 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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 (-----) I have found a poor error message in env (GNU coreutils) 8.23, on FC22. --- I created the following executable file, with a DOS line-end: #!/usr/bin/env sh When run, it displays the following error message on my terminal: : No such file or directory This error message is cryptic. However, if you process stderr through `cat -v` to display nonprintable characters, you find the error message has a CR in it: /usr/bin/env: sh^M: No such file or directory and the CR caused the second half of the error message to over-write the first half when displayed on-screen. --- To diagnose the problem I had to use strace, so IMO this error message could be improved by expanding out control characters. For example see how bash handles an analogous situation, with the script: #!/usr/bin/sh Which displays: bash: ./tmp.sh: /usr/bin/sh^M: bad interpreter: No such file or directory Here, bash has expanded out the ^M before displaying it, showing that something is stuck on the end of the #! line. -- Simon Richard Clarkstone, CoreFiling Limited Software Engineer, Data Modelling http://www.corefiling.com/ Phone: +44-1865-203192 From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 22 18:58:02 2016 Received: (at 24055-done) by debbugs.gnu.org; 22 Jul 2016 22:58:02 +0000 Received: from localhost ([127.0.0.1]:34078 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQjOM-0000g3-9X for submit@debbugs.gnu.org; Fri, 22 Jul 2016 18:58:02 -0400 Received: from mail.magicbluesmoke.com ([82.195.144.49]:37882) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bQjOK-0000fd-7d for 24055-done@debbugs.gnu.org; Fri, 22 Jul 2016 18:58:00 -0400 Received: from [192.168.1.80] (unknown [109.77.96.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.magicbluesmoke.com (Postfix) with ESMTPSA id B7B36223; Fri, 22 Jul 2016 23:57:58 +0100 (IST) Subject: Re: bug#24055: Bug: #!/usr/bin/env gives poor error message for DOS line-endings To: Simon Richard Clarkstone , 24055-done@debbugs.gnu.org References: <169e7463-532b-27b3-e4cf-c453993a5e9b@corefiling.com> From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: <5792A4F6.8080901@draigBrady.com> Date: Fri, 22 Jul 2016 23:57:58 +0100 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: <169e7463-532b-27b3-e4cf-c453993a5e9b@corefiling.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 24055-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: 0.0 (/) On 22/07/16 21:39, Simon Richard Clarkstone wrote: > I have found a poor error message in env (GNU coreutils) 8.23, on FC22. > > --- > > I created the following executable file, with a DOS line-end: > > #!/usr/bin/env sh > > When run, it displays the following error message on my terminal: > > : No such file or directory > > This error message is cryptic. However, if you process stderr through > `cat -v` to display nonprintable characters, you find the error message > has a CR in it: > > /usr/bin/env: sh^M: No such file or directory That's fixed by the new file name quoting in coreutils 8.25. The new output is: /usr/bin/env: ‘sh\r’: No such file or directory thanks, Pádraig. From unknown Tue Jun 17 22:16:20 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 20 Aug 2016 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator