[Bug 230507] sed 'q' command preventing -i from creating backup

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Fri Aug 10 15:21:02 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230507

            Bug ID: 230507
           Summary: sed 'q' command preventing -i from creating backup
           Product: Base System
           Version: 11.2-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: bugs at FreeBSD.org
          Reporter: freebsd at tim.thechases.com

To reproduce

    $ jot 5 > a
    $ wc -c a # it's 10 bytes
      10
    $ sed -e '/2/d;q' a # this is the expected output
    1
    $ sed -i.bak '/2/d;q' a # demonstrate issue
    $ wc -c a # it's still 10 bytes
      10
    $ ls a*  # there's no a.bak file
    a

I've not yet traced down the source of the issue, but there seems to be some
odd interaction between `q` and `-i`.

Original thread on Twitter where the issue was noticed:

https://twitter.com/mulle_nat/status/1027907848423067650

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list