From unknown Sat Sep 13 11:54:20 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#35993 <35993@debbugs.gnu.org> To: bug#35993 <35993@debbugs.gnu.org> Subject: Status: Windows port redirection bug Reply-To: bug#35993 <35993@debbugs.gnu.org> Date: Sat, 13 Sep 2025 18:54:20 +0000 retitle 35993 Windows port redirection bug reassign 35993 sed submitter 35993 nlweb@sapo.pt severity 35993 normal tag 35993 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Wed May 29 11:24:20 2019 Received: (at submit) by debbugs.gnu.org; 29 May 2019 15:24:20 +0000 Received: from localhost ([127.0.0.1]:59635 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hW0R9-0008B4-RD for submit@debbugs.gnu.org; Wed, 29 May 2019 11:24:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53297) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hVzxL-0007KX-Bg for submit@debbugs.gnu.org; Wed, 29 May 2019 10:53:34 -0400 Received: from lists.gnu.org ([209.51.188.17]:38010) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVzxF-0000lC-26 for submit@debbugs.gnu.org; Wed, 29 May 2019 10:53:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39428) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVzxD-000457-QO for bug-sed@gnu.org; Wed, 29 May 2019 10:53:24 -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, RCVD_IN_DNSWL_NONE, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVzxB-0000e3-KE for bug-sed@gnu.org; Wed, 29 May 2019 10:53:23 -0400 Received: from relay3.ptmail.sapo.pt ([212.55.154.23]:38950) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVzx7-0000TB-LR for bug-sed@gnu.org; Wed, 29 May 2019 10:53:19 -0400 Received: (qmail 20547 invoked from network); 29 May 2019 14:53:09 -0000 Received: from [::ffff:194.65.37.70] ([::ffff:194.65.37.70]) by mail.sapo.pt (Horde Framework) with HTTPS; Wed, 29 May 2019 15:53:06 +0100 Date: Wed, 29 May 2019 15:53:06 +0100 Message-ID: <20190529155306.Horde.cuERg586p64vM6XXH0PxSp5@mail.sapo.pt> From: nlweb@sapo.pt To: bug-sed@gnu.org Subject: Windows port redirection bug User-Agent: IMP PTMail 6.1.13 X-Originating-IP: ::ffff:194.65.37.70 X-PTMail-Version: PTMail 6.1.13 X-PTMail-User: eyJpdiI6IkkwRmNZaG1qcVdpUW0yYXFsaGJGdmc9PSIsImQiOiJHYVVWUFV2aVY2cnRoKzdLM084eTlBPT0ifQ== Content-Type: multipart/alternative; boundary="=_pl9HCIUD8tfrplSy0kTKtJM" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 212.55.154.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 29 May 2019 11:24:18 -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: -2.3 (--) This message is in MIME format. --=_pl9HCIUD8tfrplSy0kTKtJM Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes Content-Description: Mensagem de Texto Content-Disposition: inline Content-Transfer-Encoding: 8bit Hi, The bug is reproducible with this command: SED 'S/"//G' TESTE.TXT > OUT.TXT It should remove double quotes and save the result in the out.txt file. With a Bash shell it works as expected, but under Windows 10's command line it prints the resulting output and issues this error:   SED: CAN'T READ >: NO SUCH FILE OR DIRECTORY SED: CAN'T READ OUT.TXT: NO SUCH FILE OR DIRECTORY Escaping the double quote doesn't change the result, but if I use another character instead, like SED 'S/X//G' TESTE.TXT > OUT.TXT it works. Sed is version 4.5 on both cases.   sed (GNU sed) 4.5 Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Jay Fenlason, Tom Lord, Ken Pizzini, and Paolo Bonzini. GNU sed home page: . General help using GNU software: . E-mail bug reports to: . Thanks! Nuno   --=_pl9HCIUD8tfrplSy0kTKtJM Content-Type: text/html; charset=utf-8 Content-Description: Mensagem HTML Content-Disposition: inline

Hi,

The bug is reproducible with this command: sed 's/"//g' teste.txt > out.txt

It should remove double quotes and save the result in the out.txt file. With a Bash shell it works as expected, but under Windows 10's command line it prints the resulting output and issues this error:
 

sed: can't read >: No such file or directory
sed: can't read out.txt: No such file or directory


Escaping the double quote doesn't change the result, but if I use another character instead, like sed 's/x//g' teste.txt > out.txt it works.

Sed is version 4.5 on both cases.
 

sed (GNU sed) 4.5
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Jay Fenlason, Tom Lord, Ken Pizzini,
and Paolo Bonzini.
GNU sed home page: <https://www.gnu.org/software/sed/>.
General help using GNU software: <https://www.gnu.org/gethelp/>.
E-mail bug reports to: <bug-sed@gnu.org>.



Thanks!

Nuno
 

--=_pl9HCIUD8tfrplSy0kTKtJM-- From debbugs-submit-bounces@debbugs.gnu.org Wed May 29 12:34:25 2019 Received: (at submit) by debbugs.gnu.org; 29 May 2019 16:34:25 +0000 Received: from localhost ([127.0.0.1]:59713 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hW1Ww-0001eP-VN for submit@debbugs.gnu.org; Wed, 29 May 2019 12:34:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:52784) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hW1Wu-0001e9-WC for submit@debbugs.gnu.org; Wed, 29 May 2019 12:34:21 -0400 Received: from lists.gnu.org ([209.51.188.17]:55148) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hW1Wp-0000c0-RX for submit@debbugs.gnu.org; Wed, 29 May 2019 12:34:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38927) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hW1Wo-0007Vy-Uz for bug-sed@gnu.org; Wed, 29 May 2019 12:34:15 -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,RCVD_IN_DNSWL_NONE, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hW1Wo-0000al-4I for bug-sed@gnu.org; Wed, 29 May 2019 12:34:14 -0400 Received: from quail.birch.relay.mailchannels.net ([23.83.209.151]:28165) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hW1Wn-0000ZH-O6 for bug-sed@gnu.org; Wed, 29 May 2019 12:34:14 -0400 X-Sender-Id: dreamhost|x-authsender|bill-auger@peers.community Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id A76105E17E9 for ; Wed, 29 May 2019 16:34:11 +0000 (UTC) Received: from pdx1-sub0-mail-a15.g.dreamhost.com (100-96-88-48.trex.outbound.svc.cluster.local [100.96.88.48]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 35C145E1670 for ; Wed, 29 May 2019 16:34:11 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|bill-auger@peers.community Received: from pdx1-sub0-mail-a15.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.2); Wed, 29 May 2019 16:34:11 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|bill-auger@peers.community X-MailChannels-Auth-Id: dreamhost X-Broad-Cold: 04b8f2be744a5a52_1559147651526_4256197402 X-MC-Loop-Signature: 1559147651526:2179816224 X-MC-Ingress-Time: 1559147651525 Received: from pdx1-sub0-mail-a15.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a15.g.dreamhost.com (Postfix) with ESMTP id 52F9E8028C for ; Wed, 29 May 2019 09:34:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=peers.community; h=date :from:to:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=peers.community; bh=N +5+GCMUAA1YIke43CK6OIRIxAg=; b=hjL1o0g2P7U4tQ9C5u5ZOCVztscY9aeeK rcvU7ckvVTdw+YZ38KBvTS3npTzk1vyOlKYvbj/dIGo418gwu4qtkjbmMnekgESU 3K/yp96weTJZBj1vLhx6UwkYjxsc/Xsg2kNVCQJPSVqN+U43J9OpBBApiGcTPjcp NMFNPMMukY= Received: from parabola (75-138-186-142.dhcp.oxfr.ma.charter.com [75.138.186.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bill-auger@peers.community) by pdx1-sub0-mail-a15.g.dreamhost.com (Postfix) with ESMTPSA id 9AB4580289 for ; Wed, 29 May 2019 09:34:06 -0700 (PDT) Date: Wed, 29 May 2019 12:32:46 -0400 X-DH-BACKEND: pdx1-sub0-mail-a15 From: bill-auger To: bug-sed@gnu.org Subject: Re: bug#35993: Windows port redirection bug Message-ID: <20190529123246.089a3fe4@parabola> In-Reply-To: <20190529155306.Horde.cuERg586p64vM6XXH0PxSp5@mail.sapo.pt> References: <20190529155306.Horde.cuERg586p64vM6XXH0PxSp5@mail.sapo.pt> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduuddruddvjedguddtfecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfgjfhfogggtgfesthejredtredtvdenucfhrhhomhepsghilhhlqdgruhhgvghruceosghilhhlqdgruhhgvghrsehpvggvrhhsrdgtohhmmhhunhhithihqeenucfkphepjeehrddufeekrddukeeirddugedvnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehprghrrggsohhlrgdpihhnvghtpeejhedrudefkedrudekiedrudegvddprhgvthhurhhnqdhprghthhepsghilhhlqdgruhhgvghruceosghilhhlqdgruhhgvghrsehpvggvrhhsrdgtohhmmhhunhhithihqedpmhgrihhlfhhrohhmpegsihhllhdqrghughgvrhesphgvvghrshdrtghomhhmuhhnihhthidpnhhrtghpthhtohepsghughdqshgvugesghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedt X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 23.83.209.151 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit 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: -2.4 (--) just a wild guess, but all those CAPITAL LETTERS look like the classic DOS shell - have you tried that in the powershell or the mingw shell? From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 01 14:55:04 2019 Received: (at 35993) by debbugs.gnu.org; 1 Jun 2019 18:55:04 +0000 Received: from localhost ([127.0.0.1]:38663 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hX99j-0000GT-UD for submit@debbugs.gnu.org; Sat, 01 Jun 2019 14:55:04 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:38278) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hX99i-0000Fq-C8; Sat, 01 Jun 2019 14:55:03 -0400 Received: by mail-pl1-f195.google.com with SMTP id f97so5348657plb.5; Sat, 01 Jun 2019 11:55:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=TBEt1rFdxwbwH8qLQ3zFsMn0xawOjYjAMHHbo8TOJuA=; b=kTGEQN1GX+mgl40H6OjDDQPAKHh8JnVUKZBWnVxTWPC6ZFteGs9Rwn8TItparWG5fH b97rpUcVa/8GF0FTdFTgS1yuRzxcJ00UD1gacECF4q2Um01CQjEFG8qM8Cqq8qUJZZjJ RFJV4393rrnDZt9p9Xd1rR9e9fZk3xyu5wZg/QsoYskVUai8ma0A2dZBEqNXSTBvy+US bjrhQ6dIkLBOnYZLaOynC5YsQFuevzQRDz0wzwqiu4BPp6KljQOaF83susZHfPQrUnFb 3gfPyZwhcZPuzPyXVvdAMzQPGQ/lqw3ZJ86C3nCSIuzoh/E3YASDBHyom/8jvUzvLbkU l+QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=TBEt1rFdxwbwH8qLQ3zFsMn0xawOjYjAMHHbo8TOJuA=; b=R9R/d2Nbl3lQB8hUxN6VQl8RJnoDfszr01pkQc1NtVNb+Xf+h7oaZv4NJqmpV5bd/K cEYlnOSPcAvUAPgE8bpNXKxqC5tdPd5QAsFCX7eS2EHkXS9XB0higXL0DTIxZ7jYRLqd XGLS2X1cD3VddpD8clpcG+XVmK2N4RiY54LrAc9bFfexvEk//bpIDn5yU/89OjSfjrRx fL8iAbi4rypPhEKLiRI5ygnOCDM2Jqf84JufWK1Upmj9kxP8fI9wJIwrIy4nhbZUxJhv WcbP5ZOnZ+drAjIkVKDT3OKocYG9Rw1c+DL+0ZoiN5Cmnpgq3a6LlkwLmbP0ytkVhKKQ tiWg== X-Gm-Message-State: APjAAAWuJouHgP307wCnpMLV2EiOzE72m66Y1RaDfhkRK2z++67Fp0hI SOtfPfFOEmUjwUYRJWnQYIbF/CU5 X-Google-Smtp-Source: APXvYqzt2ju4FI+6E5NrTykHdDNSpF+FejjvAcEnngMkDJObdw2cWSVdpREHVZA/8x4mpi6jEprNEQ== X-Received: by 2002:a17:902:683:: with SMTP id 3mr16955080plh.209.1559415295610; Sat, 01 Jun 2019 11:54:55 -0700 (PDT) Received: from tomato (moose.housegordon.com. [184.68.105.38]) by smtp.gmail.com with ESMTPSA id q125sm22134715pfq.62.2019.06.01.11.54.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 01 Jun 2019 11:54:53 -0700 (PDT) Received: by tomato (Postfix, from userid 1000) id BCCBA682F0D; Sat, 1 Jun 2019 12:54:52 -0600 (MDT) Date: Sat, 1 Jun 2019 12:54:52 -0600 From: Assaf Gordon To: nlweb@sapo.pt Subject: Re: bug#35993: Windows port redirection bug Message-ID: <20190601185452.GD7392@tomato.moose.housegordon.com> References: <20190529155306.Horde.cuERg586p64vM6XXH0PxSp5@mail.sapo.pt> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190529155306.Horde.cuERg586p64vM6XXH0PxSp5@mail.sapo.pt> User-Agent: Mutt/1.11.4 (2019-03-13) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35993 Cc: 35993@debbugs.gnu.org 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: -1.0 (-) tags 35993 notabug close 35993 stop Hello, On Wed, May 29, 2019 at 03:53:06PM +0100, nlweb@sapo.pt wrote: > The bug is reproducible with this command: SED 'S/"//G' TESTE.TXT > OUT.TXT > > It should remove double quotes and save the result in the out.txt file. With > a Bash shell it works as expected, but under Windows 10's command line it > prints the resulting output and issues this error: >   > SED: CAN'T READ >: NO SUCH FILE OR DIRECTORY > SED: CAN'T READ OUT.TXT: NO SUCH FILE OR DIRECTORY > > Escaping the double quote doesn't change the result, but if I use another > character instead, like SED 'S/X//G' TESTE.TXT > OUT.TXT it works. > This is not a bug in sed - just incorrect usage of quotes in the Windows command prompt (CMD.EXE). Before going into (long) details, here's the solution: c:\Users\gordon\Desktop> type teste.txt hello"world c:\Users\gordon\Desktop> sed-4.7-64bit.exe "s/\"/XXX/g" teste.txt helloXXXworld or even: c:\Users\gordon\Desktop> sed-4.7-64bit.exe s/\"/XXX/g teste.txt helloXXXworld Now some details: 1. Single-quotes have special meaning AT ALL in cmd.exe. There's no point using them. In fact, they will just cause more problems, as they are passed as-is to the sed program, and sed will complain that a single-quote is not a recognizable sed command: c:\Users\gordon\Desktop> sed-4.7-64bit.exe ' sed-4.7-64bit.exe: -e expression #1, char 1: unknown command: `'' 2. Double-quotes DO NOT behave like you expect if you are familiar with unix-style shell quoting. In unix-world, quotes (both single and double) act in pairs (opening and closing), and we can speak about "text inside single/double quotes" and "text outside quotes". A side-effect of this approach is that strings with unbalanced quotes result in parsing error. E.g. the following is not a complete/valid command in unix: echo hello"world 3. In windows' CMD.EXE, double-quote character (ONE character) changes an internal parsing state which controls whether special characters are important or ignored (surprising/unintuitive if you're coming from unix world). a SPACE character is the most common example of special characters. For example, in CMD.EXE the following is valid command: echo foo > hello" world.txt And it will create a file named HELLOWORLDTXT . The above string is parsed like so: 1. 'hello' - as is 2. double-quote - turns on "special character handling" state. 3. space character - kept (not ignored) because of the new state. 4. 'world.txt' - as is. Another example, the following two commands are valid in CMD.EXE. In the second command, once a double-quote character is encountered, The PIPE character (loses its special meaning and is just consumed as part of the string): c:\Users\gordon\Desktop\a>echo "hello world" | more "hello world" c:\Users\gordon\Desktop\a>echo "hello | more "hello | more 4. For more strange cases, try the following: c:\Users\gordon\Desktop\c> echo foo > hello.txt c:\Users\gordon\Desktop\c> echo foo > "hello world.txt" c:\Users\gordon\Desktop\c> echo foo > hello" w o r l d.txt c:\Users\gordon\Desktop\c> echo foo > hello" world.txt c:\Users\gordon\Desktop\c> echo foo > 'hello world.txt' c:\Users\gordon\Desktop\c> dir Volume in drive C is OS Volume Serial Number is 4CA3-CC48 Directory of c:\Users\gordon\Desktop\c 06/01/2019 12:50 PM . 06/01/2019 12:50 PM .. 06/01/2019 12:50 PM 17 'hello 06/01/2019 12:50 PM 6 hello world.txt 06/01/2019 12:50 PM 6 hello w o r l d.txt 06/01/2019 12:49 PM 6 hello world.txt 06/01/2019 12:49 PM 6 hello.txt 5 File(s) 41 bytes 2 Dir(s) 384,140,804,096 bytes free 5. To go even deeper into the nitty-gritty of CMD.EXE parsing and quoting, see this interesting blog post: http://www.windowsinspired.com/understanding-the-command-line-string-and-arguments-received-by-a-windows-program/ As such, I'm closing this as "not a bug", but discussion can continue by replying to this thread. regards, - assaf P.S. A newer version of SED (version 4.7) was released in December 2019, and it contains few minor fixes/changes to behaviour on windows. See here on how to build and/or download the binaries: https://lists.gnu.org/archive/html/sed-devel/2018-12/msg00031.html From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 01 17:32:31 2019 Received: (at 35993) by debbugs.gnu.org; 1 Jun 2019 21:32:31 +0000 Received: from localhost ([127.0.0.1]:38786 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hXBc4-0006ON-DK for submit@debbugs.gnu.org; Sat, 01 Jun 2019 17:32:29 -0400 Received: from relay4.ptmail.sapo.pt ([212.55.154.24]:51771) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hX9Ms-0002ie-Cy for 35993@debbugs.gnu.org; Sat, 01 Jun 2019 15:08:39 -0400 Received: (qmail 11642 invoked from network); 1 Jun 2019 19:08:35 -0000 Received: (qmail 29133 invoked from network); 1 Jun 2019 19:08:34 -0000 Received: from unknown (HELO [192.168.10.178]) (nlweb@sapo.pt@[82.154.112.65]) (envelope-sender ) by ptmail-mta-auth01 (qmail-ptmail-1.0.0) with ESMTPSA for <35993@debbugs.gnu.org>; 1 Jun 2019 19:08:34 -0000 X-PTMail-RemoteIP: 82.154.112.65 X-PTMail-AllowedSender-Action: X-PTMail-Service: default Subject: Re: bug#35993: Windows port redirection bug To: Assaf Gordon References: <20190529155306.Horde.cuERg586p64vM6XXH0PxSp5@mail.sapo.pt> <20190601185452.GD7392@tomato.moose.housegordon.com> From: Nuno Leal Message-ID: <99d400aa-eb2e-5eb0-0db8-e8d6f8a0c8dd@sapo.pt> Date: Sat, 1 Jun 2019 20:08:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <20190601185452.GD7392@tomato.moose.housegordon.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: pt-PT X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35993 X-Mailman-Approved-At: Sat, 01 Jun 2019 17:32:27 -0400 Cc: 35993@debbugs.gnu.org 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: -1.0 (-) Hi Assaf! I mentioned that escaping the quote wouldn't work either. Now I can't test is, but I recall doing SED 'S/\"//G' TESTE.TXT > OUT.TXT and getting the same error result. Monday I'll do some more tests and get back to you with my findings, if they're relevant. I'm curious about the newer 4.7 version! Thanks! Nuno On 01/06/19 19:54, Assaf Gordon wrote: > tags 35993 notabug > close 35993 > stop > > Hello, > > On Wed, May 29, 2019 at 03:53:06PM +0100, nlweb@sapo.pt wrote: >> The bug is reproducible with this command: SED 'S/"//G' TESTE.TXT > OUT.TXT >> >> It should remove double quotes and save the result in the out.txt file. With >> a Bash shell it works as expected, but under Windows 10's command line it >> prints the resulting output and issues this error: >> >> SED: CAN'T READ >: NO SUCH FILE OR DIRECTORY >> SED: CAN'T READ OUT.TXT: NO SUCH FILE OR DIRECTORY >> >> Escaping the double quote doesn't change the result, but if I use another >> character instead, like SED 'S/X//G' TESTE.TXT > OUT.TXT it works. >> > This is not a bug in sed - just incorrect usage of quotes in the Windows > command prompt (CMD.EXE). > > Before going into (long) details, here's the solution: > > c:\Users\gordon\Desktop> type teste.txt > hello"world > > c:\Users\gordon\Desktop> sed-4.7-64bit.exe "s/\"/XXX/g" teste.txt > helloXXXworld > > or even: > > c:\Users\gordon\Desktop> sed-4.7-64bit.exe s/\"/XXX/g teste.txt > helloXXXworld > > > Now some details: > > 1. > Single-quotes have special meaning AT ALL in cmd.exe. > There's no point using them. In fact, they will just cause more > problems, as they are passed as-is to the sed program, and sed will > complain that a single-quote is not a recognizable sed command: > > c:\Users\gordon\Desktop> sed-4.7-64bit.exe ' > sed-4.7-64bit.exe: -e expression #1, char 1: unknown command: `'' > > > 2. > Double-quotes DO NOT behave like you expect if you are > familiar with unix-style shell quoting. > > In unix-world, quotes (both single and double) act in pairs (opening > and closing), and we can speak about "text inside single/double quotes" and > "text outside quotes". > > A side-effect of this approach is that strings with unbalanced quotes > result in parsing error. E.g. the following is not a complete/valid > command in unix: > > echo hello"world > > 3. > In windows' CMD.EXE, double-quote character (ONE character) changes an > internal parsing state which controls whether special characters are > important or ignored (surprising/unintuitive if you're coming from unix > world). a SPACE character is the most common example of special > characters. > > For example, in CMD.EXE the following is valid command: > > echo foo > hello" world.txt > > And it will create a file named HELLOWORLDTXT . > > The above string is parsed like so: > 1. 'hello' - as is > 2. double-quote - turns on "special character handling" state. > 3. space character - kept (not ignored) because of the new state. > 4. 'world.txt' - as is. > > Another example, the following two commands are valid in CMD.EXE. > In the second command, once a double-quote character is encountered, > The PIPE character (loses its special meaning and is just consumed as > part of the string): > > c:\Users\gordon\Desktop\a>echo "hello world" | more > "hello world" > > > c:\Users\gordon\Desktop\a>echo "hello | more > "hello | more > > > 4. > For more strange cases, try the following: > > c:\Users\gordon\Desktop\c> echo foo > hello.txt > c:\Users\gordon\Desktop\c> echo foo > "hello world.txt" > c:\Users\gordon\Desktop\c> echo foo > hello" w o r l d.txt > c:\Users\gordon\Desktop\c> echo foo > hello" world.txt > c:\Users\gordon\Desktop\c> echo foo > 'hello world.txt' > > c:\Users\gordon\Desktop\c> dir > Volume in drive C is OS > Volume Serial Number is 4CA3-CC48 > > Directory of c:\Users\gordon\Desktop\c > > 06/01/2019 12:50 PM . > 06/01/2019 12:50 PM .. > 06/01/2019 12:50 PM 17 'hello > 06/01/2019 12:50 PM 6 hello world.txt > 06/01/2019 12:50 PM 6 hello w o r l d.txt > 06/01/2019 12:49 PM 6 hello world.txt > 06/01/2019 12:49 PM 6 hello.txt > 5 File(s) 41 bytes > 2 Dir(s) 384,140,804,096 bytes free > > 5. > To go even deeper into the nitty-gritty of CMD.EXE parsing and quoting, > see this interesting blog post: > http://www.windowsinspired.com/understanding-the-command-line-string-and-arguments-received-by-a-windows-program/ > > > As such, I'm closing this as "not a bug", but discussion can continue > by replying to this thread. > > regards, > - assaf > > > P.S. > A newer version of SED (version 4.7) was released in December 2019, > and it contains few minor fixes/changes to behaviour on windows. > See here on how to build and/or download the binaries: > > https://lists.gnu.org/archive/html/sed-devel/2018-12/msg00031.html > From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 05 11:27:54 2019 Received: (at 35993) by debbugs.gnu.org; 5 Jun 2019 15:27:54 +0000 Received: from localhost ([127.0.0.1]:47930 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hYXpP-0003my-Vh for submit@debbugs.gnu.org; Wed, 05 Jun 2019 11:27:53 -0400 Received: from relay4.ptmail.sapo.pt ([212.55.154.24]:49705) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hYXpN-0003mn-DC for 35993@debbugs.gnu.org; Wed, 05 Jun 2019 11:27:51 -0400 Received: (qmail 11265 invoked from network); 5 Jun 2019 15:27:47 -0000 Received: from [::ffff:194.65.37.73] ([::ffff:194.65.37.73]) by mail.sapo.pt (Horde Framework) with HTTPS; Wed, 05 Jun 2019 16:27:46 +0100 Date: Wed, 05 Jun 2019 16:27:46 +0100 Message-ID: <20190605162746.Horde.brhOy1f366WQ8uR4zA0uX-S@mail.sapo.pt> From: nlweb@sapo.pt To: Assaf Gordon Subject: Re: bug#35993: Windows port redirection bug References: <20190529155306.Horde.cuERg586p64vM6XXH0PxSp5@mail.sapo.pt> <20190601185452.GD7392@tomato.moose.housegordon.com> In-Reply-To: <20190601185452.GD7392@tomato.moose.housegordon.com> User-Agent: IMP PTMail 6.1.13 X-Originating-IP: ::ffff:194.65.37.73 X-PTMail-Version: PTMail 6.1.13 X-PTMail-User: eyJpdiI6ImtvYmlneVRzbllCSGJUYkRLZ2ZhMHc9PSIsImQiOiJ5TEV0ci8vVlZFcXFCb3orSEtmYWFBPT0ifQ== Content-Type: multipart/alternative; boundary="=_5TQv1SRZ6ZlN5XGPWZrti7C" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35993 Cc: 35993@debbugs.gnu.org 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: -1.0 (-) This message is in MIME format. --=_5TQv1SRZ6ZlN5XGPWZrti7C Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes Content-Description: Mensagem de Texto Content-Disposition: inline Content-Transfer-Encoding: 8bit Hi Assaf, These are my findings on Windows 10:   S:\temp>type teste.txt hello"world S:\temp>SED 's/"//g' teste.txt > out.txt SED: can't read >: No such file or directory SED: can't read out.txt: No such file or directory helloworld S:\temp>SED s/\"//g teste.txt > out.txt SED: -e expression #1, char 26: unterminated `s' command S:\temp>SED "s/\"//g" teste.txt > out.txt SED: can't read >: No such file or directory SED: can't read out.txt: No such file or directory helloworld S:\temp>sed-4.7-64bit s/\"//g teste.txt > out.txt helloworldsed-4.7-64bit: can't read >: Invalid argument sed-4.7-64bit: can't read out.txt: No such file or directory S:\temp>sed-4.7-64bit "s/\"//g" teste.txt > out.txt helloworldsed-4.7-64bit: can't read >: Invalid argument sed-4.7-64bit: can't read out.txt: No such file or directory As you can see, the problem persists. My goal is to remove double quotes, so I replace them with nothing. This command line works inside a bash shell, but gives the above errors under Windows. Thanks! Nuno Citando Assaf Gordon : > tags 35993 notabug > close 35993 > stop > > Hello, > > On Wed, May 29, 2019 at 03:53:06PM +0100, nlweb@sapo.pt wrote: >> The bug is reproducible with this command: SED 'S/"//G' TESTE.TXT > OUT.TXT >> >> It should remove double quotes and save the result in the out.txt file. With >> a Bash shell it works as expected, but under Windows 10's command line it >> prints the resulting output and issues this error: >>   >> SED: CAN'T READ >: NO SUCH FILE OR DIRECTORY >> SED: CAN'T READ OUT.TXT: NO SUCH FILE OR DIRECTORY >> >> Escaping the double quote doesn't change the result, but if I use another >> character instead, like SED 'S/X//G' TESTE.TXT > OUT.TXT it works. > > This is not a bug in sed - just incorrect usage of quotes in the Windows > command prompt (CMD.EXE). > > Before going into (long) details, here's the solution: > >    c:\Users\gordon\Desktop> type teste.txt >    hello"world > >    c:\Users\gordon\Desktop> sed-4.7-64bit.exe "s/\"/XXX/g" teste.txt >    helloXXXworld > > or even: > >    c:\Users\gordon\Desktop> sed-4.7-64bit.exe s/\"/XXX/g teste.txt >    helloXXXworld > > Now some details: > > 1. > Single-quotes have special meaning AT ALL in cmd.exe. > There's no point using them. In fact, they will just cause more > problems, as they are passed as-is to the sed program, and sed will > complain that a single-quote is not a recognizable sed command: > >   c:\Users\gordon\Desktop> sed-4.7-64bit.exe ' >   sed-4.7-64bit.exe: -e expression #1, char 1: unknown command: `'' > > 2. > Double-quotes DO NOT behave like you expect if you are > familiar with unix-style shell quoting. > > In unix-world, quotes (both single and double) act in pairs (opening > and closing), and we can speak about "text inside single/double quotes" and > "text outside quotes". > > A side-effect of this approach is that strings with unbalanced quotes > result in parsing error. E.g. the following is not a complete/valid > command in unix: > >     echo hello"world > > 3. > In windows' CMD.EXE, double-quote character (ONE character) changes an > internal parsing state which controls whether special characters are > important or ignored (surprising/unintuitive if you're coming from unix > world). a SPACE character is the most common example of special > characters. > > For example, in CMD.EXE the following is valid command: > >    echo foo > hello" world.txt > > And it will create a file named HELLOWORLDTXT . > > The above string is parsed like so: >    1. 'hello' - as is >    2. double-quote - turns on "special character handling" state. >    3. space character - kept (not ignored) because of the new state. >    4. 'world.txt' - as is. > > Another example, the following two commands are valid in CMD.EXE. > In the second command, once a double-quote character is encountered, > The PIPE character (loses its special meaning and is just consumed as > part of the string): > >    c:\Users\gordon\Desktop\a>echo "hello world" | more >    "hello world" > >    c:\Users\gordon\Desktop\a>echo "hello | more >    "hello | more > > 4. > For more strange cases, try the following: > >    c:\Users\gordon\Desktop\c> echo foo > hello.txt >    c:\Users\gordon\Desktop\c> echo foo > "hello world.txt" >    c:\Users\gordon\Desktop\c> echo foo > hello" w o r l d.txt >    c:\Users\gordon\Desktop\c> echo foo > hello"   world.txt >    c:\Users\gordon\Desktop\c> echo foo > 'hello world.txt' > >    c:\Users\gordon\Desktop\c> dir >     Volume in drive C is OS >     Volume Serial Number is 4CA3-CC48 > >     Directory of c:\Users\gordon\Desktop\c > >    06/01/2019  12:50 PM              . >    06/01/2019  12:50 PM              .. >    06/01/2019  12:50 PM                17 'hello >    06/01/2019  12:50 PM                 6 hello   world.txt >    06/01/2019  12:50 PM                 6 hello w o r l d.txt >    06/01/2019  12:49 PM                 6 hello world.txt >    06/01/2019  12:49 PM                 6 hello.txt >                   5 File(s)             41 bytes >                   2 Dir(s)  384,140,804,096 bytes free > > 5. > To go even deeper into the nitty-gritty of CMD.EXE parsing and quoting, > see this interesting blog post: > http://www.windowsinspired.com/understanding-the-command-line-string-and-arguments-received-by-a-windows-program/ > > As such, I'm closing this as "not a bug", but discussion can continue > by replying to this thread. > > regards, > - assaf > > P.S. > A newer version of SED (version 4.7) was released in December 2019, > and it contains few minor fixes/changes to behaviour on windows. > See here on how to build and/or download the binaries: > https://lists.gnu.org/archive/html/sed-devel/2018-12/msg00031.html   --=_5TQv1SRZ6ZlN5XGPWZrti7C Content-Type: text/html; charset=utf-8 Content-Description: Mensagem HTML Content-Disposition: inline

Hi Assaf,

These are my findings on Windows 10:
 

S:\temp>type teste.txt
hello"world

S:\temp>SED 's/"//g' teste.txt > out.txt
SED: can't read >: No such file or directory
SED: can't read out.txt: No such file or directory
helloworld

S:\temp>SED s/\"//g teste.txt > out.txt
SED: -e expression #1, char 26: unterminated `s' command

S:\temp>SED "s/\"//g" teste.txt > out.txt
SED: can't read >: No such file or directory
SED: can't read out.txt: No such file or directory
helloworld

S:\temp>sed-4.7-64bit s/\"//g teste.txt > out.txt
helloworldsed-4.7-64bit: can't read >: Invalid argument
sed-4.7-64bit: can't read out.txt: No such file or directory

S:\temp>sed-4.7-64bit "s/\"//g" teste.txt > out.txt
helloworldsed-4.7-64bit: can't read >: Invalid argument
sed-4.7-64bit: can't read out.txt: No such file or directory


As you can see, the problem persists. My goal is to remove double quotes, so I replace them with nothing. This command line works inside a bash shell, but gives the above errors under Windows.

Thanks!

Nuno

Citando Assaf Gordon <assafgordon@gmail.com>:

tags 35993 notabug
close 35993
stop

Hello,

On Wed, May 29, 2019 at 03:53:06PM +0100, nlweb@sapo.pt wrote:

The bug is reproducible with this command: SED 'S/"//G' TESTE.TXT > OUT.TXT

It should remove double quotes and save the result in the out.txt file. With
a Bash shell it works as expected, but under Windows 10's command line it
prints the resulting output and issues this error:
 
SED: CAN'T READ >: NO SUCH FILE OR DIRECTORY
SED: CAN'T READ OUT.TXT: NO SUCH FILE OR DIRECTORY

Escaping the double quote doesn't change the result, but if I use another
character instead, like SED 'S/X//G' TESTE.TXT > OUT.TXT it works.

This is not a bug in sed - just incorrect usage of quotes in the Windows
command prompt (CMD.EXE).

Before going into (long) details, here's the solution:

   c:\Users\gordon\Desktop> type teste.txt
   hello"world

   c:\Users\gordon\Desktop> sed-4.7-64bit.exe "s/\"/XXX/g" teste.txt
   helloXXXworld

or even:

   c:\Users\gordon\Desktop> sed-4.7-64bit.exe s/\"/XXX/g teste.txt
   helloXXXworld


Now some details:

1.
Single-quotes have special meaning AT ALL in cmd.exe.
There's no point using them. In fact, they will just cause more
problems, as they are passed as-is to the sed program, and sed will
complain that a single-quote is not a recognizable sed command:

  c:\Users\gordon\Desktop> sed-4.7-64bit.exe '
  sed-4.7-64bit.exe: -e expression #1, char 1: unknown command: `''


2.
Double-quotes DO NOT behave like you expect if you are
familiar with unix-style shell quoting.

In unix-world, quotes (both single and double) act in pairs (opening
and closing), and we can speak about "text inside single/double quotes" and
"text outside quotes".

A side-effect of this approach is that strings with unbalanced quotes
result in parsing error. E.g. the following is not a complete/valid
command in unix:

    echo hello"world

3.
In windows' CMD.EXE, double-quote character (ONE character) changes an
internal parsing state which controls whether special characters are
important or ignored (surprising/unintuitive if you're coming from unix
world). a SPACE character is the most common example of special
characters.

For example, in CMD.EXE the following is valid command:

   echo foo > hello" world.txt

And it will create a file named HELLO<SPACE>WORLD<DOT>TXT .

The above string is parsed like so:
   1. 'hello' - as is
   2. double-quote - turns on "special character handling" state.
   3. space character - kept (not ignored) because of the new state.
   4. 'world.txt' - as is.

Another example, the following two commands are valid in CMD.EXE.
In the second command, once a double-quote character is encountered,
The PIPE character (loses its special meaning and is just consumed as
part of the string):

   c:\Users\gordon\Desktop\a>echo "hello world" | more
   "hello world"


   c:\Users\gordon\Desktop\a>echo "hello | more
   "hello | more


4.
For more strange cases, try the following:

   c:\Users\gordon\Desktop\c> echo foo > hello.txt
   c:\Users\gordon\Desktop\c> echo foo > "hello world.txt"
   c:\Users\gordon\Desktop\c> echo foo > hello" w o r l d.txt
   c:\Users\gordon\Desktop\c> echo foo > hello"   world.txt
   c:\Users\gordon\Desktop\c> echo foo > 'hello world.txt'

   c:\Users\gordon\Desktop\c> dir
    Volume in drive C is OS
    Volume Serial Number is 4CA3-CC48

    Directory of c:\Users\gordon\Desktop\c

   06/01/2019  12:50 PM    <DIR>          .
   06/01/2019  12:50 PM    <DIR>          ..
   06/01/2019  12:50 PM                17 'hello
   06/01/2019  12:50 PM                 6 hello   world.txt
   06/01/2019  12:50 PM                 6 hello w o r l d.txt
   06/01/2019  12:49 PM                 6 hello world.txt
   06/01/2019  12:49 PM                 6 hello.txt
                  5 File(s)             41 bytes
                  2 Dir(s)  384,140,804,096 bytes free

5.
To go even deeper into the nitty-gritty of CMD.EXE parsing and quoting,
see this interesting blog post:
http://www.windowsinspired.com/understanding-the-command-line-string-and-arguments-received-by-a-windows-program/


As such, I'm closing this as "not a bug", but discussion can continue
by replying to this thread.

regards,
- assaf


P.S.
A newer version of SED (version 4.7) was released in December 2019,
and it contains few minor fixes/changes to behaviour on windows.
See here on how to build and/or download the binaries:
https://lists.gnu.org/archive/html/sed-devel/2018-12/msg00031.html


 

--=_5TQv1SRZ6ZlN5XGPWZrti7C-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 06 02:49:05 2019 Received: (at 35993) by debbugs.gnu.org; 6 Jun 2019 06:49:05 +0000 Received: from localhost ([127.0.0.1]:48745 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hYmCv-0005D1-0v for submit@debbugs.gnu.org; Thu, 06 Jun 2019 02:49:05 -0400 Received: from mail-pf1-f169.google.com ([209.85.210.169]:35313) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hYmCs-0005CX-PN for 35993@debbugs.gnu.org; Thu, 06 Jun 2019 02:49:03 -0400 Received: by mail-pf1-f169.google.com with SMTP id d126so902437pfd.2 for <35993@debbugs.gnu.org>; Wed, 05 Jun 2019 23:49:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=cn+jntfXYyamnXfSi4KPSJvC3TYmTYl5bZ7n7gQ5HsA=; b=O8/BvzUx8wa3A+V9BcYwwHJsHWBde6IRfMkI6/72PpOQDhNiJygZXdOJIyWwAYwwDl RC0s1gi4NllSRvpTDkNjjaTZXUtPC+fCVTBfO0F4bSSbE2IyhsERmrcEY0+XUAr4zY6U 8oT7vOAbN4wLe4xiIKnI7zChLHRBNZAK4CQvOJCya1YvXwz3qbQUXPg4haBHXLE8cHEu eyctPT2qIOoWdnHvuEBQI/jMmsCdcReEulwRjB6i97djTIV/OSoP/fj5tFP9dJ7dKEpZ Q23V5DnIlEwEOHJTLqw7+l01fiilCQbn9FXrE7ftx2h3nOPpC/l5qGbfgs3dUIXEmpkG rX6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=cn+jntfXYyamnXfSi4KPSJvC3TYmTYl5bZ7n7gQ5HsA=; b=JzT39NMYhGKpmVW1s4yZ545hCYOuQA7eg+UUsMQYGSvlfsMLm1/zy9w0oxkHJoE74U 1tXEOy6dzgqXWHLI9HDi79GZ4mZeEBXZruqCmRnwCfddXry0Ph0GTVYoF3NOlnSKl6Ja 5pyHypi49qyDCQc8UCrlybnn/qnun7uiOlPj016BIIiFEJHrEJbeQAwvCNX+6m5tknIW KcCTA3ulsO9Sif4waPZCBPM6SxI6EwUBoCIn6W9onDO1SakFKRh5zEqucE+vS3jsTbv0 uWdteHHHZVfWUQzZ/4meesqCiA6kbDWU+4fTaqYzamnDj3eOnR+++KcTnrMABMz3UETC 8HBA== X-Gm-Message-State: APjAAAVaaD27wMKK827xH1bN6SfNhg4xNSeheEMGWg+kn8aQKKSM+Xq7 SdphCqHMHlCtFz/VlZL0+MOUE0mg X-Google-Smtp-Source: APXvYqyBWRJI0ywm82CCupBF5qz+PrB7yQYqwH5Rbv51u5/2PMUcoHuf6RdyBT8WC6PvGwO8n+HOvg== X-Received: by 2002:a17:90a:6544:: with SMTP id f4mr7617252pjs.17.1559803736113; Wed, 05 Jun 2019 23:48:56 -0700 (PDT) Received: from tomato (moose.housegordon.com. [184.68.105.38]) by smtp.gmail.com with ESMTPSA id u5sm735106pgp.19.2019.06.05.23.48.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Jun 2019 23:48:54 -0700 (PDT) Received: by tomato (Postfix, from userid 1000) id 3AF026811E2; Thu, 6 Jun 2019 00:48:53 -0600 (MDT) Date: Thu, 6 Jun 2019 00:48:53 -0600 From: Assaf Gordon To: nlweb@sapo.pt Subject: Re: bug#35993: Windows port redirection bug Message-ID: <20190606064853.GB18519@tomato.moose.housegordon.com> References: <20190529155306.Horde.cuERg586p64vM6XXH0PxSp5@mail.sapo.pt> <20190601185452.GD7392@tomato.moose.housegordon.com> <20190605162746.Horde.brhOy1f366WQ8uR4zA0uX-S@mail.sapo.pt> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190605162746.Horde.brhOy1f366WQ8uR4zA0uX-S@mail.sapo.pt> User-Agent: Mutt/1.11.4 (2019-03-13) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 35993 Cc: 35993@debbugs.gnu.org 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: -1.0 (-) Hello, It is worth repeating: none of these are bugs in sed itself (that is - there is nothing to change/fix in sed to make it work). These are problems in the shell usage (e.g. CMD.EXE in windows 10). On Wed, Jun 05, 2019 at 04:27:46PM +0100, nlweb@sapo.pt wrote: > These are my findings on Windows 10: > S:\temp>sed-4.7-64bit s/\"//g teste.txt > out.txt > helloworldsed-4.7-64bit: can't read >: Invalid argument > sed-4.7-64bit: can't read out.txt: No such file or directory > > S:\temp>sed-4.7-64bit "s/\"//g" teste.txt > out.txt > helloworldsed-4.7-64bit: can't read >: Invalid argument > sed-4.7-64bit: can't read out.txt: No such file or directory I do not have access to a Windows 10 machine, so my results are from Windows 7. I just double-checked and the above two commands work well for me in windows 7 with cmd.exe. To verify: are you using the standard CMD.EXE or something else ? > As you can see, the problem persists. My goal is to remove double quotes, so > I replace them with nothing. This command line works inside a bash shell, > but gives the above errors under Windows. As you wrote, it works well (and as expected) in 'bash' shell. Hence it is a problem in the usage of quoting in your terminal (cmd.exe?), not in sed. There is not much more we can do as sed developers. You might want to ask in Microsoft forums about quoting rules in windows 10. regards, - assaf From unknown Sat Sep 13 11:54: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: Thu, 04 Jul 2019 11:24:07 +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