From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 06 13:56:31 2021 Received: (at submit) by debbugs.gnu.org; 6 Jan 2021 18:56:31 +0000 Received: from localhost ([127.0.0.1]:45567 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kxDyx-0000Bv-Id for submit@debbugs.gnu.org; Wed, 06 Jan 2021 13:56:31 -0500 Received: from lists.gnu.org ([209.51.188.17]:45394) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kxDyh-0000BX-Fx for submit@debbugs.gnu.org; Wed, 06 Jan 2021 13:56:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kxDyh-0000GL-7Z for bug-coreutils@gnu.org; Wed, 06 Jan 2021 13:56:15 -0500 Received: from sonic315-54.consmr.mail.gq1.yahoo.com ([98.137.65.30]:42391) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kxDye-00083b-Gv for bug-coreutils@gnu.org; Wed, 06 Jan 2021 13:56:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1609959369; bh=EY6prqiRgxeeMISZqWu3ZtG0KMK5Gkk3e6e69b/teV8=; h=Date:From:Reply-To:To:Subject:References:From:Subject; b=oBrKuMl4T8H1rWLri0tAnclXd8xGproCHwiiiK+m8vODVbfMv7aAoz8dSPLI0GavKg7rnLMWiYiPL9qQvB6HSksKJVslI9mcBt4IE+xu/8d0ypY7JSqFfMEcSokIrw6wBmluDB8v1/PKZkdfD1IAIxs88WKOHy/BZfusKcbYareVveRawSyOZZ+rBBGnYCN3kscN+8NHYYUwyfRbdwLZ9AfwxM63TrqEMsAK/6tqWpXMCWD5GoXYbaL/WmOSOe1+eN71sHaDtDwCwL97YUancC95uTmFzePXKgA07WkwNprdLB9jvvokpD3gsDHkc7cMcQ3lIwN1H3cAj28zo3WXcA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1609959369; bh=Dr88Sv63ttauyCrK8B5Sm1wpLS2YVsjqiBpCT0tL8bN=; h=Date:From:To:Subject:From:Subject; b=GKdkTWtCYlI9oZAjYtxFMLt57KVMxNoO1OqBGLcaRM+pz61Fj/Nj3tl8jtsGywZ5NTQOmUA6ZeweCdYGcI5G8hXEZRDFiQRZ0jgdHBaXUEocbnVlUzJrsmuefWBej2Ihz4npef+TM74+APZZQRfkxxcHuzCxplFDOf6jp3Ya3kj4M6/llJLt/u9oP071B2BEXblUIKTMSCohNNv/JPZcM+TBZhMMJ9ost/AOJGGTGEqJB6Ug52F7azQLN5StIuC2SloONLXPsb5G8yrnkqGqpk9BMTrL/zLTzfrh7tv+MriVUGMrcNMC/50MayejoGi5HqdjqX7Y+wCWlSn4cZ1oqg== X-YMail-OSG: _6MjH.8VM1lWL5r34a06Sf2sD0hPB50CyDNG6LY_g9YFHg.csANtD.4m9PZUwiN QZ5ZYufLdGIUwR0Xix2hy_hN.9a4nmPzzy.yBlE8ojjZjO7JFicrO8sEuabtDQV8GODgknH27.az BPpsIgHN9TK3ratzzdkDdPzVPC8m.OMlWZ9t5wHmC8w9zs0TCqxGXrwOiK6GpGTIC8Dwj8ys9W_S mXJC.5Ccb0xuOmdOLrTLTf5C1ErbDj_yIsF_1LsCMpsgivnlUQIIlNerMOEYCiaRAnavHN9IhVVI 63wM079BCChCRIUchDh8gO6L9xmozYWw3EZhfO_qysmqWBza3YFY4J30nCBYFaN.BeKD56ttrxuf yEffYrSQKgn6F_BhonSFHITLz1hyMNNZz.AxHx9mDZYk7o7z6D0jfxOqAaMBcnWaAtmeDTdl0A4D u_ESjNHUjxvRDRGGDmQHUdu_9g53Ggh5YwjPlb7dyo5EGlATGbOdPX3GoqYG8d0fqU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Rz um5m8b4s.wOv0eSe4borjkymuCKFAczYmlxzTDf59ltQd_ZdfT0dQvS6VPGfLu818guc8zLvGvMM HtjauFvltfNKl1NqS9ksW_07iZ_m2dsmL4438PZqYa72KMjHQvQ87M3r6A0YG2E7D_YHJrJ4TWug Sl7tNpufkfVjac0748QM90OKu4Skv2LaL_jCKZZc2QHrw2gX3ZjntBRxwrHOLBbR2C3QBApn1L.z OagfKlHf0k95rDvx998Wh.zDIfr_fLGaU3ijBdT0O5IjkZASJUzjL5soLYnUXRf7wpQNn8SZ49ba NZCQfNQrqwUSDMMQYdBBPZphOUyMF1nbob9bOMnceYcjTV3UQSuJLQoIweiICtaGSVN9TF7TZ7dO 787syxT87RsWAgIw82FP5BUjUBK5W5TnSnVpsBHiHLGPmQoe2psQ_XiR1LII4TQPZL_5QyGkL6mc pw1b7MWQ.OREOBP3J56TrZf69W99jd53R165zzl7eRaKWXJPpphxs6OO8MoFLfT4dcTd70IpbluH GAsVlUwI_rYSDd8D8UhQTjwnICtGFQ0r6SvCr1gpuXgSK00.8G_cMl.X.VsJpK_AeNJY8caa6VR2 y7uuvnQlxpr1jVIYPbujAxvnFESFL51bfP2UPv2TwhsaTCydAyn2SH0Zazd2aWsCYs6BMqEfD0VL DUrS9jtpyTQESP2ENmCtxubVkVjjnED9CsuyXfG764dNS8BvjNMrfXvUfM0eAdw2MUBhFUhxyAPl ogSUqzTfQaIm3rlkDHJSkNB_6xH9Ok3DTGbH5yrBB_wskKjT.HpCrUIuCMTDbo8fLudA9VMCIihO uIaYm27L7hPuT745pjTYevrC94uTzOyIx1PY- Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.gq1.yahoo.com with HTTP; Wed, 6 Jan 2021 18:56:09 +0000 Date: Wed, 6 Jan 2021 18:56:02 +0000 (UTC) From: John Wiersba To: "bug-coreutils@gnu.org" Message-ID: <847284856.6040792.1609959362554@mail.yahoo.com> Subject: rm should not prompt if ! isatty(2) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_6040791_953589494.1609959362553" References: <847284856.6040792.1609959362554.ref@mail.yahoo.com> X-Mailer: WebService/1.1.17278 YMailNorrin Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0 Content-Length: 3156 Received-SPF: pass client-ip=98.137.65.30; envelope-from=jrw32982@yahoo.com; helo=sonic315-54.consmr.mail.gq1.yahoo.com X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, FREEMAIL_REPLYTO_END_DIGIT=0.25, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.5 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: $ /bin/rm --version rm (GNU coreutils) 8.30 $ uname -a Linux xxx 5.4.0-59-generic #65-Ubuntu SMP Thu Dec 10 12:01:51 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux $ lsb_release -a No LSB modules are available. Distributor ID:    Linuxmint Description:    Linux Mint 20 Release:    20 Codename:    ulyana Content analysis details: (1.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (jrw32982[at]yahoo.com) 1.0 FORGED_YAHOO_RCVD 'From' yahoo.com does not match 'Received' headers 0.2 FREEMAIL_REPLYTO_END_DIGIT Reply-To freemail username ends in digit (jrw32982[at]yahoo.com) 0.0 T_SPF_TEMPERROR SPF: test of record failed (temperror) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (jrw32982[at]yahoo.com) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.0 HTML_MESSAGE BODY: HTML included in message 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: , Reply-To: John Wiersba Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.1 (-) ------=_Part_6040791_953589494.1609959362553 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable $ /bin/rm --version rm (GNU coreutils) 8.30 $ uname -a Linux xxx 5.4.0-59-generic #65-Ubuntu SMP Thu Dec 10 12:01:51 UTC 2020 x86_= 64 x86_64 x86_64 GNU/Linux $ lsb_release -a No LSB modules are available. Distributor ID:=C2=A0=C2=A0 =C2=A0Linuxmint Description:=C2=A0=C2=A0 =C2=A0Linux Mint 20 Release:=C2=A0=C2=A0 =C2=A020 Codename:=C2=A0=C2=A0 =C2=A0ulyana $ touch asdf && chmod a-w asdf && rm asdf 2>&1 | catrm: remove write-protec= ted regular empty file 'asdf'?=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 # should *not* prompt If the prompt cannot be seen, then it can't be properly answered, so there = is no point in prompting and consequently leaving the user with a hanging c= ommand and no way to know what's being expected of them.=C2=A0 Instead rm s= hould attempt to remove the file and succeed or fail based on the result.= =C2=A0 Same for any other commands (mv, cp) in similar situations. I know about the options -f and --interactive=3Dnever, but they shouldn't b= e needed in this case. Thanks! ------=_Part_6040791_953589494.1609959362553 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
$ /bin/rm --version
rm (GNU coreutils) 8.30

$ uname -a
Linux= xxx 5.4.0-59-generic #65-Ubuntu SMP Thu Dec 10 12:01:51 UTC 2020 x86_64 x8= 6_64 x86_64 GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor I= D:    Linuxmint
Description:    Linux Mint= 20
Release:    20
Codename:    ulyana<= br>
$ touch asdf &&= chmod a-w asdf && rm asdf 2>&1 | cat
rm: remov= e write-protected regular empty file 'asdf'?     &= nbsp;    # should *not* prompt

If the prompt cannot be seen, then it can= 't be properly answered, so there is no point in prompting and consequently= leaving the user with a hanging command and no way to know what's being ex= pected of them.  Instead rm should attempt to remove the file and succ= eed or fail based on the result.  Same for any other commands (mv, cp)= in similar situations.
I know about the options -f a= nd --interactive=3Dnever, but they shouldn't be needed in this case.

Thanks!
=
------=_Part_6040791_953589494.1609959362553-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 06 14:17:08 2021 Received: (at 45700) by debbugs.gnu.org; 6 Jan 2021 19:17:08 +0000 Received: from localhost ([127.0.0.1]:45587 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kxEIt-0000hI-O1 for submit@debbugs.gnu.org; Wed, 06 Jan 2021 14:17:08 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:37958) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kxEIr-0000gj-0t for 45700@debbugs.gnu.org; Wed, 06 Jan 2021 14:17:06 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id C770D16012A; Wed, 6 Jan 2021 11:16:58 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 3oLC01nHapcG; Wed, 6 Jan 2021 11:16:57 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id E2D4D16011D; Wed, 6 Jan 2021 11:16:57 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 9w83ng0bocvv; Wed, 6 Jan 2021 11:16:57 -0800 (PST) Received: from [192.168.1.9] (cpe-23-243-218-95.socal.res.rr.com [23.243.218.95]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id BC456160110; Wed, 6 Jan 2021 11:16:57 -0800 (PST) Subject: Re: bug#45700: rm should not prompt if ! isatty(2) To: John Wiersba References: <847284856.6040792.1609959362554.ref@mail.yahoo.com> <847284856.6040792.1609959362554@mail.yahoo.com> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: Date: Wed, 6 Jan 2021 11:16:57 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <847284856.6040792.1609959362554@mail.yahoo.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.5 (--) X-Debbugs-Envelope-To: 45700 Cc: 45700@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: -3.5 (---) On 1/6/21 10:56 AM, John Wiersba via GNU coreutils Bug Reports wrote: > $ touch asdf && chmod a-w asdf && rm asdf 2>&1 | catrm: remove write-pr= otected regular empty file 'asdf'?=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 # should*not* prompt >=20 > If the prompt cannot be seen, then it can't be properly answered, so th= ere is no point in prompting and consequently leaving the user with a han= ging command and no way to know what's being expected of them.=C2=A0 Inst= ead rm should attempt to remove the file and succeed or fail based on the= result. POSIX requires the current behavior; see clause 3 in: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/rm.html Although GNU rm needn't follow POSIX blindly, it's doubtful that rm=20 should remove the file in this particular case, as the longstanding=20 tradition is that plain "rm" does not remove unwriteable files without=20 more confirmation. Since you know about "rm -f" I suggest using that (that's what everyone=20 else does...). From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 06 15:32:02 2021 Received: (at 45700) by debbugs.gnu.org; 6 Jan 2021 20:32:02 +0000 Received: from localhost ([127.0.0.1]:45681 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kxFTO-0002WW-6c for submit@debbugs.gnu.org; Wed, 06 Jan 2021 15:32:02 -0500 Received: from sonic317-20.consmr.mail.gq1.yahoo.com ([98.137.66.146]:37856) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kxFTK-0002W5-T6 for 45700@debbugs.gnu.org; Wed, 06 Jan 2021 15:32:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1609965110; bh=qgnIbKjahky4l1dtNHj4EH639OOVRN2GCze9WvkO1zg=; h=Date:From:Reply-To:To:Cc:In-Reply-To:References:Subject:From:Subject; b=qt7qVSEA8r8SW0EguJFfqmYsYByxLwepdLc4swR4q6GntKkUf8kVHXyly8RMk6qwR5j9ACAWN6M9yrYdn0uoJpKZM+g/h6uiYzoT7EUVJEcT2+G/1RDRFAoQUT51T7AbFRBLEATKSdWSbWmSB0aJBdtevhAoQzs9ujOWGETM4vRPe29vjc70njG87k8tCbzJynSHrJ5TsRHwVEGAPY0cWpxqmuMDACuILe4cxNcmWxXfZoOKF2r4CPk+e/cI024YuyoHQ08q4f17d+2DDWFwpzLaRcVSTRO/MTndYDz0MHY2SN0I4qrbr0aROCLinu5TWG+jYFv9dFKT89PQ5gyjIg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1609965110; bh=CGzNxK1jhI/AwpaE4I8ndPJXqLV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3nm57xYTa2ltA31HSnOetyk5z7VNF75DTTRg sVe5qTtMvv_0Iod3CGMBpuEi5EcrDl6kZ_Cck2oFFZcVqfQuUTVH2sz8dlVp0CC2dwie641MXzVz V7Ij7CM5G.zQpi6fqL7pUb3iKvJA7rSEZRmRb3OnvX6s6dkiHzuIe4DS85nzQakPujyAD2j8D1I3 KmI14U_yEEeOIXFJfCITEHde84k3vbEqACehAXjIVJPsuj5vz3pa_dYWYrukgvM_3PlcFkLvFUe7 A058fYVFD0veqiIArJUt4AC_SWfEiaaI9XzuTQiWeF89qizd8ZXbeKPHimKrR6WgoXFWlEsJSJZH iHQOqalfNF4jalhPm8RpOM7jj9ZMQEQcfWUOQXhua8ApulgXx5JAT21PKHlFV5HfmJo9RLIk8zlS K3RQzZyvF_EAhWuXQQPBdI4jV78F.Wa.aGVMjJoeXz.y75sih602mQDhLpPVGHbwcEgWNuexpaSu PjhjOYJAcu_s2tH9bf8vQU627Mbp2FMxF1r1seoOuZ1HHMtWPmxpkXkg.4qU6owKrmiZ9vyZicjM afdBzRh8Wbvz.zGnm4I5PecH88NjWWPAGRy.k2OG1BG3bW32OPWjzv5ncoVox3YFGsmGMXovP1Yu PswIrvWGWwjx1kAb2YI19dS_bcQ1rTKa55hN3rro9.2SbbLRL8fgpytqWD3r_yQq5GTaJLbDat8S xX7bIv64RE5UbmQ9O8na.P1txrh6A5DaA4qbObdSwqYHmxbHQ3R4- Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.gq1.yahoo.com with HTTP; Wed, 6 Jan 2021 20:31:50 +0000 Date: Wed, 6 Jan 2021 20:31:47 +0000 (UTC) From: John Wiersba To: Paul Eggert Message-ID: <1382246848.6074362.1609965107397@mail.yahoo.com> In-Reply-To: References: <847284856.6040792.1609959362554.ref@mail.yahoo.com> <847284856.6040792.1609959362554@mail.yahoo.com> Subject: Re: bug#45700: rm should not prompt if ! isatty(2) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_6074361_511971415.1609965107396" X-Mailer: WebService/1.1.17278 YMailNorrin Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0 Content-Length: 5871 X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 45700 Cc: "45700@debbugs.gnu.org" <45700@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: , Reply-To: John Wiersba Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) ------=_Part_6074361_511971415.1609965107396 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks for your reply, Paul! I see what you're talking about; thanks for the link.=C2=A0 The POSIX spec = seems broken in that regard.=C2=A0 I guess I'm going to be adding -f to my = scripts!=C2=A0 (I was surprised to see my script hang today for this very r= eason).=C2=A0=20 Maybe something could be added to the FAQ or the manpage?=C2=A0 I didn't se= e anything documented about prompting for an unwritable file.=C2=A0 Althoug= h I'd seen those prompts before, I was surprised to find that prompting hap= pens even when stdout is not a tty.=C2=A0 Something like this maybe: Per the POSIX spec, rm will prompt to stderr before removing an unwritable = file, even if stderr is not a tty. Another possibility is to add a timeout on the prompt when writing a prompt= to a non-tty (with an inferred reply of "no"). -- John On Wednesday, January 6, 2021, 2:17:00 PM EST, Paul Eggert wrote: =20 =20 On 1/6/21 10:56 AM, John Wiersba via GNU coreutils Bug Reports wrote: > $ touch asdf && chmod a-w asdf && rm asdf 2>&1 | catrm: remove write-prot= ected regular empty file 'asdf'?=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 # should*not*=C2=A0 prompt >=20 > If the prompt cannot be seen, then it can't be properly answered, so ther= e is no point in prompting and consequently leaving the user with a hanging= command and no way to know what's being expected of them.=C2=A0 Instead rm= should attempt to remove the file and succeed or fail based on the result. POSIX requires the current behavior; see clause 3 in: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/rm.html Although GNU rm needn't follow POSIX blindly, it's doubtful that rm=20 should remove the file in this particular case, as the longstanding=20 tradition is that plain "rm" does not remove unwriteable files without=20 more confirmation. Since you know about "rm -f" I suggest using that (that's what everyone=20 else does...). =20 ------=_Part_6074361_511971415.1609965107396 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks for your reply, Paul!=

I see what you're talking about; thanks for the link.&nb= sp; The POSIX spec seems broken in that regard.  I guess I'm going to = be adding -f to my scripts!  (I was surprised to see my script hang to= day for this very reason). 

Maybe something cou= ld be added to the FAQ or the manpage?  I didn't see anything document= ed about prompting for an unwritable file.  Although I'd seen those pr= ompts before, I was surprised to find that prompting happens even when stdo= ut is not a tty.  Something like this maybe:
Per the POSIX spec, rm will = prompt to stderr before removing an unwritable file, even if stderr is not = a tty.
Another possibility is to add a timeout on the prompt when writing a prom= pt to a non-tty (with an inferred reply of "no").

-- John=

=20
=20
On Wednesday, January 6, 2021, 2:17:00 PM EST, Paul Egg= ert <eggert@cs.ucla.edu> wrote:


On 1/6/21 10:56 AM, John Wiersba via = GNU coreutils Bug Reports wrote:

> $ touch asdf && = chmod a-w asdf && rm asdf 2>&1 | catrm: remove write-protect= ed regular empty file 'asdf'?       &nbs= p;  # should*not*  prompt
>
> If the prompt cannot be seen, then it can't be properly answered, s= o there is no point in prompting and consequently leaving the user with a h= anging command and no way to know what's being expected of them.  Inst= ead rm should attempt to remove the file and succeed or fail based on the r= esult.


POSIX requires the curren= t behavior; see clause 3 in:

https://pubs.opengroup.org/on= linepubs/9699919799/utilities/rm.html

Although GNU rm needn't follow POSIX blindly, it's doubtful that rm should remove the file in this particular case, as the long= standing
tradition is that plain "rm" does not remove un= writeable files without
more confirmation.

Since you know about "rm -f" I suggest using that (= that's what everyone
else does...).
------=_Part_6074361_511971415.1609965107396-- From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 21 05:07:19 2022 Received: (at control) by debbugs.gnu.org; 21 Feb 2022 10:07:19 +0000 Received: from localhost ([127.0.0.1]:35125 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nM5bC-000710-UX for submit@debbugs.gnu.org; Mon, 21 Feb 2022 05:07:19 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:50900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nM5bA-00070m-Li for control@debbugs.gnu.org; Mon, 21 Feb 2022 05:07:17 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id CBC83160103 for ; Mon, 21 Feb 2022 02:07:10 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id pU8ggTA_GIUg for ; Mon, 21 Feb 2022 02:07:10 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 39B66160106 for ; Mon, 21 Feb 2022 02:07:10 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id YTtUGD4EEzS5 for ; Mon, 21 Feb 2022 02:07:10 -0800 (PST) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 1812E160103 for ; Mon, 21 Feb 2022 02:07:10 -0800 (PST) Message-ID: <9bcb9cf6-f624-45be-a13b-1f7753d938db@cs.ucla.edu> Date: Mon, 21 Feb 2022 02:07:09 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US To: control@debbugs.gnu.org From: Paul Eggert Organization: UCLA Computer Science Department Subject: coreutils bugs Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) 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: -3.3 (---) tags 47085 notabug close 47085 close 47014 severity 46346 wishlist severity 46169 wishlist severity 45924 wishlist tags 45700 notabug close 45700 From unknown Sun Jun 22 20:58:06 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 21 Mar 2022 11:24:04 +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