You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In GNU sed, the in-place options supports the following format:
$ sed -i script file # no backup file produced
$ sed --in-place script file # no backup file produced
$ sed -i[SUFFIX] script file # backup file of form: file[SUFFIX]
$ sed --in-place=[SUFFIX] script file # backup file of form: file[SUFFIX]
The current argument parsing function, however, consumes the successive argument for in-place option without checking the form. This is also mentioned in #229.
$ cat tempquick brown fox
$ ./target/release/sed -i 's/fox/vox/' tempsed: <script argument 1>:1:1: error: undefined label `emp'
$ sed -i 's/fox/vox/' temp
$ cat tempquick brown vox
$ sed -i.bak 's/vox/fox/' temp
$ ls -1temptemp.bak
Activity
PranavRJoshi commentedon May 13, 2026
For the format:
$ sed -i[SUFFIX] file scriptIt should be noted that
-iand[SUFFIX]must not be space-separated.