[Bug 14691] New: Confusing message when calling sed -i incorrectly

bugzilla at busybox.net bugzilla at busybox.net
Sat Mar 26 10:20:22 UTC 2022


https://bugs.busybox.net/show_bug.cgi?id=14691

            Bug ID: 14691
           Summary: Confusing message when calling sed -i incorrectly
           Product: Busybox
           Version: 1.33.x
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P5
         Component: Other
          Assignee: unassigned at busybox.net
          Reporter: infor at rudhar.com
                CC: busybox-cvs at busybox.net
  Target Milestone: ---

When calling sed in BusyBox v1.34.1 erroneously as:
sed -i -f script
where script exists and contains valid sed commands, the error message is:
sed: -i requires an argument

That is correct, but confusing. I first thought it referred to the optional
argument of -i, a filename suffix for a backup of the file to be edited in
place (or backups of the files ..., etc.). But being optional, that argument is
not required.

GNU sed (4.7) in the same situation says:
sed: no input files
which I think makes it clearer what the actual error is: sed can edit a stdin
stream, but not edit it in place. So when using the -i option, you must specify
the names of one of more files to be edited, files that reside on disk. Without
-i, that is not required.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the busybox-cvs mailing list