Bug 14691

Summary: Confusing message when calling sed -i incorrectly
Product: Busybox Reporter: Ruud Harmsen <infor>
Component: OtherAssignee: unassigned
Status: NEW ---    
Severity: minor CC: busybox-cvs
Priority: P5    
Version: 1.33.x   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

Description Ruud Harmsen 2022-03-26 10:20:22 UTC
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.