-i, --in-place
Edit files in place; -iSUFFIX or --in-place=SUFFIX also keeps each original under that suffix.
An option of sedx.
Usage
sedx -i {script-only-if-no-other-script} [input-file]...
sedx --in-place {script-only-if-no-other-script} [input-file]...Details
| Short | Long | Value | Default | Meaning |
|---|---|---|---|---|
-i | --in-place | none | edit files in place; -iSUFFIX or --in-place=SUFFIX also keeps each original under that suffix |
Examples
Point a config file at a new host, keeping the original as config.ini.bak
sedx -i.bak 's/^host = .*/host = db2.internal/' config.iniAdd a line after the one that matches, in every YAML file of a directory
sedx -i '/^dependencies:/a\ - gnux' *.yamlRemove trailing white space from every source file, in place
sedx -i 's/[[:space:]]*$//' main.go util.goHelp in the terminal
gnux help sedx --in-place