From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 05 20:53:22 2018 Received: (at submit) by debbugs.gnu.org; 6 Jul 2018 00:53:22 +0000 Received: from localhost ([127.0.0.1]:48107 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbEzw-0000aS-FE for submit@debbugs.gnu.org; Thu, 05 Jul 2018 20:53:22 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbEdw-0008Tx-O2 for submit@debbugs.gnu.org; Thu, 05 Jul 2018 20:30:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fbEdq-0001xi-Ll for submit@debbugs.gnu.org; Thu, 05 Jul 2018 20:30:31 -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.3 required=5.0 tests=BAYES_40, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:43717) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fbEdq-0001xT-J5 for submit@debbugs.gnu.org; Thu, 05 Jul 2018 20:30:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58573) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbEdp-0003dE-8h for bug-sed@gnu.org; Thu, 05 Jul 2018 20:30:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fbEdo-0001v8-8F for bug-sed@gnu.org; Thu, 05 Jul 2018 20:30:29 -0400 Received: from mail-it0-x229.google.com ([2607:f8b0:4001:c0b::229]:37988) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fbEdn-0001tp-Uq for bug-sed@gnu.org; Thu, 05 Jul 2018 20:30:28 -0400 Received: by mail-it0-x229.google.com with SMTP id v71-v6so4329498itb.3 for ; Thu, 05 Jul 2018 17:30:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=iHoPG2Xwxih9OF5huOyqdP1cZyX6bUWb464ZylkW4dI=; b=d29OcSLkSuo6OspIWjoU5PH0uCdvXr4QASKU8N2s07JKW2RBR3vdVqmt954qH0RDvt QLUCc5g4Md1SSGy2sm5OSrJNpcLKyLyv/f1sY/sppWLYuIgi4eeWBxdTKc0QeljlZHcK R/25VHkDqwnaWjav4wee5H0rn6DGvK3zfVfPUGoMuCpHIQHHoDM0s7MEf+km2yvFk8n1 AAVbYLXpMW80GS+b7x/tWbJ/r8SEewjRRlNvMSd9Mz8v5UL/mPFo1SVk7KYpVg2see5c /d0bWms1Mh3EETVAYQvhxtKDgMxJhdEtAtC9sSXUdaqfpnd9/1r4GVUnywzdey6K3Ku4 5EVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=iHoPG2Xwxih9OF5huOyqdP1cZyX6bUWb464ZylkW4dI=; b=Lx5fCrhRhsdXPA4aDNHmG60c7eXTBFCd2blRRPMA4z62XsvzC5GfP8IxJnffJ4CRmR T/QtEaL1JC8UNNXDpRYyrP8PaC+T6HzlUoNQjymXl5XkcIMqH6M3VjeD+Jaxl8NVVofY zWTVbW48Wfql5jMyphTmokAiaLM4r0BfiYM70CP2nnI7vFORNsw0pP2FCXcElISqZ82x 3h9eex94xmWzlGm0KTn0IgnQKc+xG4SjgYb91B1HWQd1O8HgiFnV/dQth7dTHV4eSrCn hyl8tWPRCHdigdRceXd7iNjzinWiE/PvJhQpzIPFoB5ijpBB0IEyoChySq2PPtEzsak7 lQ+g== X-Gm-Message-State: APt69E1PQx5g+BSKsQaakCgP9wNtuVRW42a5qbQiTCMqzjxLgPrkr4RQ siVglxvh05GesxNkCIaNiij8x+3RgCOXoEVzrNHM+7rh X-Google-Smtp-Source: AAOMgpdRBxIzWV+NlAyBgoV81rV5ZS+h8xrfeLUBo3r4M9CIo0w1J7MRmvqVhPGr0+jVF2sbZlbAKILm4rTmyIAZqak= X-Received: by 2002:a02:982:: with SMTP id 2-v6mr6453487jam.79.1530837026700; Thu, 05 Jul 2018 17:30:26 -0700 (PDT) MIME-Version: 1.0 From: Matthew Jenkins Date: Thu, 5 Jul 2018 19:30:15 -0500 Message-ID: Subject: Man page description is wrong for -i To: bug-sed@gnu.org Content-Type: text/plain; charset="UTF-8" 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: -3.8 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 05 Jul 2018 20:53:19 -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: -4.8 (----) [mjenkins@hulk ~]$ sed --version 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: . On Fedora 28. In the man page the description for -i is as follows: -i[SUFFIX], --in-place[=SUFFIX] edit files in place (makes backup if SUFFIX supplied) However the actual behavior is it's replacing the original with a copy and not editing in place. This can cause confusion for why sed is breaking hardlinks. Example: [mjenkins@hulk test]$ touch banana [mjenkins@hulk test]$ stat banana | grep Inode Device: fd07h/64775d Inode: 8782051 Links: 1 [mjenkins@hulk test]$ sed -i '' banana [mjenkins@hulk test]$ stat banana | grep Inode Device: fd07h/64775d Inode: 8781989 Links: 1 I'm pretty sure replacing with the copy is intentional behavior, so can the manual be updated to reflect this? Thanks, Matthew From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 06 02:31:59 2018 Received: (at 32069) by debbugs.gnu.org; 6 Jul 2018 06:31:59 +0000 Received: from localhost ([127.0.0.1]:48179 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbKHf-0002Hl-II for submit@debbugs.gnu.org; Fri, 06 Jul 2018 02:31:59 -0400 Received: from mail-pf0-f170.google.com ([209.85.192.170]:47056) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbKHe-0002HT-6V; Fri, 06 Jul 2018 02:31:58 -0400 Received: by mail-pf0-f170.google.com with SMTP id l123-v6so7536846pfl.13; Thu, 05 Jul 2018 23:31:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=bc+BOcAfwBz1N6+DF9izB/ShuikMSNHMs64vAPsz2Pc=; b=f/EGXAHpRW2RC0i4eW0Gj39FMCQ6/kUY+xYynY8T0v6+W4/Eho3wGk5pL1DnNE2HDC JekAjukqoqzS9/xcK8h9S+6+NHwJOnX/Wg8B/JU+2XBAy0w7Vm7CqvjtK+5W3cdwNf1n hDQYTxhUdu2yRI1Bby2vSy5PUlehopfN4SwitrlWbQcc55ouSY8fdreoBkWkUuVve+2l Qnr50MIdZmP+9RzCZzjqupd3UAx05Njrkoq+TjM1NxgOqe64r3LA3ssdWLAGHVgYkVPt eUrm9kXsdMHDDN2iJVSHDVGN3gef3bh7SXw3Bc3q5VZp4OKyEwMVU8XK+Dc2m/Uv/wYl n2gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=bc+BOcAfwBz1N6+DF9izB/ShuikMSNHMs64vAPsz2Pc=; b=XDp/XpBw8Tx3FzOdqiJ6ViWQtoAAbaGAHQJBq2B99jUEACyBFGQjAKyWuoKLz3bba5 m24WxebyjF6x1D49FbN0GxseUDjFxm20ibf7NJXD/Y9kaGuTbCqRckGXtGDi6gKw4Ok6 vK/Z/iD8EoSFgLjNqAQBVkQiEuAphRx8BIzHQCBozj3fLavGaAVFV5oFrqKSf3HI33bZ 53sXA8IFF3zQd7edVpg4+o2AN7bUXAEEPGR0yxEhdTkAwh3xV+IJhxeTvH1e/cTegcUu r+klL2vXHe6zBSsWhYEoNZ2y1X8mztWCE0LKJYgr98XNfd4BFNTqo3RtgN8Wu/fgHUCZ zxhw== X-Gm-Message-State: APt69E3OjDtX14OFtJ4RtCJ/Jg+OJoKLMkOkD8X7dgaqZoSJ+wfKMwuo mcFQqbLSn8EXPKROKa/KfG7nQmFs X-Google-Smtp-Source: AAOMgpdv9o7KCBUIQBylTV4FxXS+fzrcwztKlRZujD7SVkY6yV8eG/4/+SH76W0KLeWuYKTSTISXFw== X-Received: by 2002:a63:551e:: with SMTP id j30-v6mr8033818pgb.92.1530858711626; Thu, 05 Jul 2018 23:31:51 -0700 (PDT) Received: from tomato.housegordon.com (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id q207-v6sm13236802pgq.11.2018.07.05.23.31.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jul 2018 23:31:50 -0700 (PDT) From: Assaf Gordon Subject: Re: bug#32069: Man page description is wrong for -i To: Matthew Jenkins , 32069@debbugs.gnu.org References: Message-ID: Date: Fri, 6 Jul 2018 00:31:49 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32069 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 (-) tag 32069 notabug close 32069 stop Hello Matthew, On 05/07/18 06:30 PM, Matthew Jenkins wrote: > In the man page the description for -i is as follows: > -i[SUFFIX], --in-place[=SUFFIX] > > edit files in place (makes backup if SUFFIX supplied) > > However the actual behavior is it's replacing the original with a copy > and not editing in place. This can cause confusion for why sed is > breaking hardlinks. Example: [....] > I'm pretty sure replacing with the copy is intentional behavior, so > can the manual be updated to reflect this? You are correct in observing that sed's "--in-place" behavior is replacing the file with a new copy (and optionally creating a backup). This has always been the "--in-place" behavior, both in GNU sed and in other seds (e.g. on FreeBSD). Same behavior is in other command-line "in-place" editing programs: perl -p -i.bak -e 's/bar/baz/' FILE ruby -p -i.bak -e '$_.upcase!' FILE The backup file (if you choose to create one) is the exact original file (with the same inode). Therefore I'm not sure if there should be an expectation that hard-links will be maintained - they have never been maintained by such in-place editing. Some interactive text editors (e.g. vim/nano) do keep the same inode, but they go to much greater lengths to do so safely. For an interesting write-up about the nuances of in-place editing in unix, please see here: https://www.pixelbeat.org/docs/unix_file_replacement.html . As such, I'm marking this item as "not a bug" and closing it, however discussion can continue by replying to this thread. If you want to suggest different wording to the "--help" usage screen or sed's manual, please send a patch - we welcome such contributions. regards, - assaf From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 06 17:31:43 2018 Received: (at 32069) by debbugs.gnu.org; 6 Jul 2018 21:31:43 +0000 Received: from localhost ([127.0.0.1]:48861 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbYKN-0002Ly-2c for submit@debbugs.gnu.org; Fri, 06 Jul 2018 17:31:43 -0400 Received: from mail-it0-f45.google.com ([209.85.214.45]:34469) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbXkb-0001M0-Ma for 32069@debbugs.gnu.org; Fri, 06 Jul 2018 16:54:46 -0400 Received: by mail-it0-f45.google.com with SMTP id d191-v6so6207589ite.1 for <32069@debbugs.gnu.org>; Fri, 06 Jul 2018 13:54:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Ld+Yb3IgfOLs74FAfx5zZzAv/qS4cUHmAjgy06tPXVQ=; b=ZUQuEXB7RThAIiCG13lDxec8s8We2iPZJy7hWFv1BfUHBXW5ls7UCdLZBvhn3Un3Xx yuHjvpkFl2X946paQ1HKHVose0S2CYGZr0H2m8DIGrOc/062zXtQ8CJZ3X2oj2g7b9es o9YcP4cYT+xCOY4y1WnyEZAb/edZXofOf7wm2A9RYcsWJjK1BksM64ylezeu8Tw+AaSi kvWY/MW14Vo9GbNhOZxeXk1gYZ+sbWu2Dyd3Uyzpq2FTUig+8KXUe4T1z5HlAk+kXxlU gNVSkUDb0T6lnh3W9LQYOas3RqmDEnB8qaeq058AS8fA7hdwzngYC9O+ZNJUJkAlfBDL bX2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Ld+Yb3IgfOLs74FAfx5zZzAv/qS4cUHmAjgy06tPXVQ=; b=kRttC+u/tnDYyeb5w6xi7ORhUcvW/lvO2L64YWWzgtU7lpw1PbM3ako0S+e2RSYeN9 OY8vvr9iuJ3o0CAkINgwNMRzrbyZBd0bOH1D82gO0X82l/Wsc3/gJKNS0/B6Gro6Jo0G AcsOZ8Qnph5KTEPVY4pVVoInEHFPeJl1+vMAJf2+tEZAPFFCqGVP1wd1EncD97z/jKKo PhIRFfNO/X6JRlBvkfndwMalWkHqijt7nwb9cKULvZ/8hgaQZIhxE59djMPo+mHMuw2D nR+UkGzth3eMd+aSDHjA7QEcmbhTRzR0gw2xaehVaGGtSRs+BnPdKYxrAoloH+TluuvX 0bNw== X-Gm-Message-State: APt69E076MSlK1GW8XNO7DLxmXhABdO2JBL44irGNHkg/W0CFt4Z2NWI CW30wChEG/c9qGvNs8re/V1yqcYb2ua6w6K2iyY= X-Google-Smtp-Source: AAOMgpfgUVdIteBNYyVmI9AtfQOFtnE0/pqtMy7IEalddNdL8ZC7jmnu6l/8ZttfjLAbYn+CYsBrxqW1Hla6rZZ2cjw= X-Received: by 2002:a24:c384:: with SMTP id s126-v6mr8707735itg.99.1530910479926; Fri, 06 Jul 2018 13:54:39 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Matthew Jenkins Date: Fri, 6 Jul 2018 15:54:29 -0500 Message-ID: Subject: Re: bug#32069: Man page description is wrong for -i To: assafgordon@gmail.com Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 32069 X-Mailman-Approved-At: Fri, 06 Jul 2018 17:31:41 -0400 Cc: 32069@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: -0.7 (/) I'm not asking to change the behavior of sed. I'm asking to have the man page reflect what sed -i actually does to at least be less wrong so it's less of a gotcha. Examples of gotchas: sed -i on a large file when you only have less than that amount of space available. sed -i on a hard link I'm sure there are more but these gotchas wouldn't be gotchas anymore with a better description. The item you linked doesn't really cover this. On Fri, Jul 6, 2018 at 1:31 AM Assaf Gordon wrote: > > tag 32069 notabug > close 32069 > stop > > Hello Matthew, > > On 05/07/18 06:30 PM, Matthew Jenkins wrote: > > In the man page the description for -i is as follows: > > -i[SUFFIX], --in-place[=SUFFIX] > > > > edit files in place (makes backup if SUFFIX supplied) > > > > However the actual behavior is it's replacing the original with a copy > > and not editing in place. This can cause confusion for why sed is > > breaking hardlinks. Example: > [....] > > I'm pretty sure replacing with the copy is intentional behavior, so > > can the manual be updated to reflect this? > > You are correct in observing that sed's "--in-place" behavior is > replacing the file with a new copy (and optionally creating a backup). > > This has always been the "--in-place" behavior, both in GNU sed and in > other seds (e.g. on FreeBSD). Same behavior is in other command-line > "in-place" editing programs: > > perl -p -i.bak -e 's/bar/baz/' FILE > ruby -p -i.bak -e '$_.upcase!' FILE > > The backup file (if you choose to create one) is the exact original file > (with the same inode). > > Therefore I'm not sure if there should be an expectation that hard-links > will be maintained - they have never been maintained by such in-place > editing. > > Some interactive text editors (e.g. vim/nano) do keep the same inode, > but they go to much greater lengths to do so safely. > > For an interesting write-up about the nuances of in-place editing in > unix, please see here: > https://www.pixelbeat.org/docs/unix_file_replacement.html . > > > As such, I'm marking this item as "not a bug" and closing it, > however discussion can continue by replying to this thread. > > If you want to suggest different wording to the "--help" usage screen > or sed's manual, please send a patch - we welcome such contributions. > > regards, > - assaf > From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 06 17:43:12 2018 Received: (at 32069) by debbugs.gnu.org; 6 Jul 2018 21:43:12 +0000 Received: from localhost ([127.0.0.1]:48872 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbYVT-0002f3-T6 for submit@debbugs.gnu.org; Fri, 06 Jul 2018 17:43:12 -0400 Received: from mail-pf0-f174.google.com ([209.85.192.174]:37258) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fbYVR-0002el-W4 for 32069@debbugs.gnu.org; Fri, 06 Jul 2018 17:43:10 -0400 Received: by mail-pf0-f174.google.com with SMTP id h20-v6so9389545pfn.4 for <32069@debbugs.gnu.org>; Fri, 06 Jul 2018 14:43:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=k47u7V6+CPEIvP84PjQ5v3cdGKhuzd5OfBI09aceXzE=; b=QkZv9ZWwZcBkNYrf+LdBVGTB7acfcOlJtUURT1XkF+PvOl/3cRnt9PhsJm9c8mgOSv 6tsFHP0w02BnNSHiO/ke26jL9LTmBTROM1YkunuSUsQVVCEtMshnQ/z3556QDKeVNOqb XLTLEh56CegKpNFSBNuMm2SbET7IMsDqMWqPhCcsXgU34aI7xXFVCXf4vFWPqpwqVEgw jqyHcWojEDMpN4ZXRGiYvTY0ZV+vCxMf2s79aRx76MqkDOfuTIDn52VVom2kuwsrI1/K mDsyBhHgRzCOzmGvzBz4bzsUzjpboWuF4+nI6Q2vrTEFW2nfYeK/lu4HOiOYTDZlOkpg YjeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=k47u7V6+CPEIvP84PjQ5v3cdGKhuzd5OfBI09aceXzE=; b=l2Q+yvXErpWddGxl50YeCDaygyT1yI9UNXfpYhehpLx0MM4Y7gD5BEobYXme5mIYCW twOI0bKU3L8gV9YH19p65GmtwAR0zpgnKCI4FAFkOR7jCfUNddKUKml0W4owYVySV+qR +rNrpFnEv2RtvgvganqAMQnTkZPOpOEy/2EfDHfCNsw4GyVc1ILqn09AubOqnKs/gRzc 0LsaJveIcmK7JVXYiQrXMhPCpEOJQhx7bJSILC9ck3HV+EzfanYVXqTWzTcw/d8CuYGq Xp+PGS06X5QxIx9LEKOftuv+Wd2BVaKv8akIWqDjIhVDzaIVYgFY5/n5vk9SgtkE6/Ry CzqQ== X-Gm-Message-State: APt69E1XvoOfeRgMHiJtDvIWwRyZ+leVe0FZMyyvafBWwVSwTZsPo6yX lw8jNrnywHxWoeZQJbox0QpHBZl3 X-Google-Smtp-Source: AAOMgpfvvgq1eJZ6sydCHyM/mrO10vS7qbdnu/haXIJ/pmUxnfmSzoru4bBVFYXrdTtPp53LIT6XXw== X-Received: by 2002:a62:ee01:: with SMTP id e1-v6mr12074847pfi.2.1530913383665; Fri, 06 Jul 2018 14:43:03 -0700 (PDT) Received: from tomato.housegordon.com (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id l4-v6sm2553493pgn.46.2018.07.06.14.43.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jul 2018 14:43:02 -0700 (PDT) Subject: Re: bug#32069: Man page description is wrong for -i To: Matthew Jenkins References: From: Assaf Gordon Message-ID: <8decad05-0af2-3faf-8569-bed8a59cf163@gmail.com> Date: Fri, 6 Jul 2018 15:43:01 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 32069 Cc: 32069@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, On 06/07/18 02:54 PM, Matthew Jenkins wrote: > I'm not asking to change the behavior of sed. I'm asking to have the > man page reflect what sed -i actually does to at least be less wrong > so it's less of a gotcha. > > Examples of gotchas: > sed -i on a large file when you only have less than that amount of > space available. > sed -i on a hard link when out of disk space, 'sed -i' behaves in a very reasonable and safe way: it will fail to create the temporary file, and leave the original file unmodified. As for 'sed -i' on hard-link: "sed -i" has never maintained hard-links with "--in-place", and neither does any other common unix utility - so it is not clear where this expectation originates from. > I'm sure there are more but these gotchas wouldn't be gotchas anymore > with a better description. "sed -i" certainly has some gotchas, and few are documented in the manual: https://www.gnu.org/software/sed/manual/sed.html#index-_002df It seems the "in-place" related topics are growing, perhaps it is warranted to dedicated a separate section in the manual. If you'd like to try and add such a section - please do send a patch. Otherwise, I will try to add something like that at a later time. regards, - assaf From unknown Fri Sep 05 08:44:01 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, 04 Aug 2018 11: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