From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 16 11:44:21 2017 Received: (at submit) by debbugs.gnu.org; 16 Nov 2017 16:44:22 +0000 Received: from localhost ([127.0.0.1]:43780 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eFNH3-0003x9-O4 for submit@debbugs.gnu.org; Thu, 16 Nov 2017 11:44:21 -0500 Received: from eggs.gnu.org ([208.118.235.92]:38220) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eFN1c-0003Zr-88 for submit@debbugs.gnu.org; Thu, 16 Nov 2017 11:28:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFN1S-0006ni-0C for submit@debbugs.gnu.org; Thu, 16 Nov 2017 11:28:18 -0500 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_20 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:46139) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eFN1R-0006nd-Sg for submit@debbugs.gnu.org; Thu, 16 Nov 2017 11:28:13 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57394) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eFN1M-00010h-4P for bug-coreutils@gnu.org; Thu, 16 Nov 2017 11:28:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eFN1H-0006cH-5I for bug-coreutils@gnu.org; Thu, 16 Nov 2017 11:28:08 -0500 Received: from mail-out-2.itc.rwth-aachen.de ([134.130.5.47]:24343) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eFN1G-0006Wb-P1 for bug-coreutils@gnu.org; Thu, 16 Nov 2017 11:28:03 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2CWRQBJvA1a/5gagoZdHQEBBQELAYM2g?= =?us-ascii?q?gCBRYIzmUKYXYIQCoUyhGpIDwEBAQEBAQEBAWsohUgVdgImAkkWDQgBAYogmH+?= =?us-ascii?q?QEoIni0MJAYEFgiWCB4FVghKCUgGGE4JJgmMFiikSmACBDmhBlE8BghOHbAWHR?= =?us-ascii?q?5YDAgICAgkCGoE5SAEPgXQ0ISaDQoILAQEIAQEBAYJGi2cBgRABAQE?= X-IPAS-Result: =?us-ascii?q?A2CWRQBJvA1a/5gagoZdHQEBBQELAYM2ggCBRYIzmUKYXYI?= =?us-ascii?q?QCoUyhGpIDwEBAQEBAQEBAWsohUgVdgImAkkWDQgBAYogmH+QEoIni0MJAYEFg?= =?us-ascii?q?iWCB4FVghKCUgGGE4JJgmMFiikSmACBDmhBlE8BghOHbAWHR5YDAgICAgkCGoE?= =?us-ascii?q?5SAEPgXQ0ISaDQoILAQEIAQEBAYJGi2cBgRABAQE?= X-IronPort-AV: E=Sophos;i="5.44,404,1505772000"; d="scan'208";a="24188660" Received: from rwthex-s1-a.rwth-ad.de ([134.130.26.152]) by mail-in-2.itc.rwth-aachen.de with ESMTP; 16 Nov 2017 17:27:59 +0100 Received: from [134.61.134.143] (134.61.134.143) by rwthex-s1-a.rwth-ad.de (2002:8682:1a98::8682:1a98) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1034.26; Thu, 16 Nov 2017 17:27:59 +0100 From: Simon Convent Subject: Potential tee bug To: Message-ID: <62a44fe7-0de9-deac-88b1-17c530fa3c1e@rwth-aachen.de> Date: Thu, 16 Nov 2017 17:27:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [134.61.134.143] X-ClientProxiedBy: rwthex-s3-a.rwth-ad.de (2002:8682:1aa0::8682:1aa0) To rwthex-s1-a.rwth-ad.de (2002:8682:1a98::8682:1a98) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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: Thu, 16 Nov 2017 11:44:20 -0500 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 (-----) Hello, when I run the command echo test | tee "~/Desktop/test.txt" I get the following error message: tee: ~/Desktop/test.txt: No such file or directory But when I run echo test | tee "/home/simon/Desktop/test.txt" , which is the same directory, tee works fine. If I omit the "", everything works fine as well. Is this behavior intended? I don't see why the "" should change the behavior like this. Best regards Simon From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 16 11:56:23 2017 Received: (at control) by debbugs.gnu.org; 16 Nov 2017 16:56:23 +0000 Received: from localhost ([127.0.0.1]:43794 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eFNSh-0004FB-6a for submit@debbugs.gnu.org; Thu, 16 Nov 2017 11:56:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58178) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eFNSd-0004Eo-4D; Thu, 16 Nov 2017 11:56:19 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 31A4D61476; Thu, 16 Nov 2017 16:56:13 +0000 (UTC) Received: from [10.10.123.34] (ovpn-123-34.rdu2.redhat.com [10.10.123.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id A09D02D256; Thu, 16 Nov 2017 16:56:12 +0000 (UTC) Subject: Re: bug#29319: Potential tee bug To: Simon Convent , 29319-done@debbugs.gnu.org References: <62a44fe7-0de9-deac-88b1-17c530fa3c1e@rwth-aachen.de> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: <237ec20f-ec10-1c21-a496-6e56661b1fa7@redhat.com> Date: Thu, 16 Nov 2017 10:56:08 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <62a44fe7-0de9-deac-88b1-17c530fa3c1e@rwth-aachen.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="m0MqNxkhnfsBID7NdodkFW99Eh5k2Jexn" X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 16 Nov 2017 16:56:13 +0000 (UTC) X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control 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 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --m0MqNxkhnfsBID7NdodkFW99Eh5k2Jexn Content-Type: multipart/mixed; boundary="uRGTvtNOl45frmkM06R1lfuSl2caNDc2l"; protected-headers="v1" From: Eric Blake To: Simon Convent , 29319-done@debbugs.gnu.org Message-ID: <237ec20f-ec10-1c21-a496-6e56661b1fa7@redhat.com> Subject: Re: bug#29319: Potential tee bug References: <62a44fe7-0de9-deac-88b1-17c530fa3c1e@rwth-aachen.de> In-Reply-To: <62a44fe7-0de9-deac-88b1-17c530fa3c1e@rwth-aachen.de> --uRGTvtNOl45frmkM06R1lfuSl2caNDc2l Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable tag 29319 notabug thanks On 11/16/2017 10:27 AM, Simon Convent wrote: > Hello, >=20 > when I run the command >=20 > echo test | tee "~/Desktop/test.txt" >=20 > I get the following error message: >=20 > tee: ~/Desktop/test.txt: No such file or directory That's because your use of quoting prevents shell tilde-expansion. Proof= : $ echo "~/Desktop" ~/Desktop >=20 > But when I run >=20 > echo test | tee "/home/simon/Desktop/test.txt" >=20 > , which is the same directory, tee works fine. No, that's not the same string. Proof: $ echo ~/Desktop /home/eblake/Desktop >=20 > If I omit the "", everything works fine as well. That's because without the "", your shell can do tilde-expansion. > Is this behavior intended? I don't see why the "" should change the > behavior like this. dd is not the change in behavior here, but your incorrect understanding of how shell quoting works. As such, I'm marking this as not a coreutils bug (as the argv[] passed to dd is AFTER the shell has already done tilde-expansion and quote removal, so dd is faithfully trying to open whatever literal string the shell handed it). But feel free to follow up with more questions if you need pointers on learning to use the shell properly. --=20 Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org --uRGTvtNOl45frmkM06R1lfuSl2caNDc2l-- --m0MqNxkhnfsBID7NdodkFW99Eh5k2Jexn Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEzBAEBCAAdFiEEccLMIrHEYCkn0vOqp6FrSiUnQ2oFAloNwygACgkQp6FrSiUn Q2rXwgf/RQ+/lH8WU4MF8Ym8xxKY4bxjXZmHEZ1xjn+07usO14A+zIiKEfUTSNTG uKklOk/oOS2EkgYvAp8BJHBD1UAEW7tAUtag4c5bECsCSR9ohun/kG5JBcZwHoUw qIqoBir6ChV9H3hZ0TOs/NQ+WDXc8abf8qM1lymdk4fTZsRNU5fsl+FG9uJ0dU0X fp2MX3VsFbUM8mpm1irleNIW5B0BWqVpD8Xqnsd9teSWeF99xaAdNc6qnXpjLWci m3HyslVPhbJ0J4NIV65WXf4i2k8XnMP92R3Brplv3/IzTmq2N+TXTgy0Z5fGekX9 EprKNWL6eEEANLyavVZtYGAtLnNCPw== =4M6B -----END PGP SIGNATURE----- --m0MqNxkhnfsBID7NdodkFW99Eh5k2Jexn-- From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 16 12:07:53 2017 Received: (at 29319) by debbugs.gnu.org; 16 Nov 2017 17:07:53 +0000 Received: from localhost ([127.0.0.1]:43808 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eFNdp-0006R3-9k for submit@debbugs.gnu.org; Thu, 16 Nov 2017 12:07:53 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:59460) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eFNdn-0006Qo-Ha for 29319@debbugs.gnu.org; Thu, 16 Nov 2017 12:07:52 -0500 Received: from [10.0.2.15] ([62.153.148.194]) by mrelayeu.kundenserver.de (mreue006 [212.227.15.167]) with ESMTPSA (Nemesis) id 0Lt8sp-1fCt8k1HZr-012oZa; Thu, 16 Nov 2017 18:07:45 +0100 Subject: Re: bug#29319: Potential tee bug To: Simon Convent , 29319@debbugs.gnu.org References: <62a44fe7-0de9-deac-88b1-17c530fa3c1e@rwth-aachen.de> From: Bernhard Voelker Message-ID: <3f0d598a-be45-8663-90d4-f3c89d11c8b6@bernhard-voelker.de> Date: Thu, 16 Nov 2017 18:07:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <62a44fe7-0de9-deac-88b1-17c530fa3c1e@rwth-aachen.de> Content-Type: text/plain; charset=utf-8 Content-Language: de-DE-1901 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:q0yYlHMkg0zwCJSI22lcrLpoDzln9CytHojbfStFH1C24zl21ki 2IBkGsjJS1LY05mOl3Lve5/YDZioIrz9pyaTWk4CJNUAbC4BIRvmyV04rkxB1gkq+J+k1nL ob/+LNmZpCTa7sDS/bhkC9G5czJnwSVDp6/oWDsou+ZPJLMZYIuB4VBisCbG3aSygFyqR9S xiihGxKd6aGAl2m1nbxxw== X-UI-Out-Filterresults: notjunk:1;V01:K0:DX79RfbKxyg=:Q6ql7wNHRwL7agN6bJ3hRF YoUmfIJx0uDOAaVNyxPxIjBlVS6/Bkhnl/8bm4w/0kcBuzhuA3FxCreMVw2sSFJJbLvNIM4cZ kaFy4lrpMin6yTIo1LoGuOe5WyuDNWpThCAU8ZrbietVW9YuZbAcW7o8CTpxGkdh+dt1JjSpP BL4A6jfJI16c9Js40UUqQdUnJqs6Rlh/JPTdeISXv2OcXBhAlEDvDhKEG9DM4zZl9UBUNStR5 KKVOGwbZAFOiapzzkEUtgouiK3lf5byPKCTEmbwasHTJTI7OR+wFt8H+X2wNZTvSO+0XTXsNK JeRKboDiBXHg0nKEpsK1aLRQNIWEGd/u6KMqjXy3F02vAzsrEHWWraLFBsMt+Euq17+pRiOMP Ae9TeGj5o1tcVwFF1XNo+gtdsQlccmSa7Oh9siUMJyJ3SpB6k8Ji9EolpGeVd0vZi73vsLE+5 t+zmFYkcbxgEOB0y79lnApG1Um2891MwppLIfihwoKT85JPs3ChHAkOAhA16hQVxSAeOPNMDh IhXgzuryYK91xYVdYU5sOOM6ztaqSV/QD2CWX9C4TPpy7k4FFNR4vvr0yeiHShw5W3z/KYTDo +U9aaLWNZuitFO8bT1Gm+ow803UgDrtSQbnp+6OcD83+vnttmhCUxMV2bThGxoxlhYvvMgWHi cKrtsdgnnJ6OjRu4MUVifkL92QX1VExhSAszXghOh3q6+7KP3S2wykbbhT04SZfitYqX13uiI 2yfVY8q8ZXYcqtcfPzICHXNQlA59k6PpAc05NEHHPdUk9aPEZ1gJtVBKrqw= X-Spam-Score: -2.8 (--) X-Debbugs-Envelope-To: 29319 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.8 (--) tag 29319 notabug close 29319 stop On 11/16/2017 05:27 PM, Simon Convent wrote: > Hello, > > when I run the command > > echo test | tee "~/Desktop/test.txt" > > I get the following error message: > > tee: ~/Desktop/test.txt: No such file or directory > > But when I run > > echo test | tee "/home/simon/Desktop/test.txt" > > , which is the same directory, tee works fine. > > If I omit the "", everything works fine as well. > Is this behavior intended? I don't see why the "" should change the behavior like this. Without quotes, the shell expands the ~ symbol to the value of the HOME environemt variable, "/home/simon" in your case, and passes that to tee as argument: $ echo tee "~/Desktop/test.txt" tee ~/Desktop/test.txt $ echo test | echo tee ~/Desktop/test.txt tee /home/voelkerb/Desktop/test.txt Therefore, tee tries to open the file with the (relative) file name "~/Desktop/test.txt"; and as you most probably do not have a directory hierarchy '~' and '~/Desktop' in your working directory, tee fails. If you want the tilde expantion and have to quote some other part of the file name, then you can do so: $ echo text | tee ~/"My Documents/test.txt" Thus, this is not a bug in tee, but in your expectations regarding the shell's tilde expansion (man bash, then search for "Tilde expansion"). I'n hereby marking and closing this issue as such in our bug tracker. Have a nice day, Berny From unknown Sun Jun 22 11:38:09 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 15 Dec 2017 12:24:05 +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