fai-sed(1)

fai-sed1

Call sed on a file but check for changes before writing

Usage

fai-sed CMD FILE

Overview

Execute a sed script - here called CMD - on FILE but do not overwrite the file if nothing changes. If $target is defined, use it as prefix for the path to FILE.

The exit status 0 indicates success. A nonzero value indicates failure.

Options

-E

If fai-sed changed the file exit with 9 instead of 0.

-n

Dry run. Print if file would have changed, but do not change it.

Examples

$ fai-sed 's/foo/bar/g' /etc/motd

Replace foo with bar in file /etc/motd.

$ fai-sed 's/123/ABC/g; /XXX/d' /etc/motd

Replace 123 with ABC and delete all lines which contain the string XXX.

Releases

3 releases since Debian 11 (Bullseye); the text changed 1 time.

  1. 11
  2. 12–13

Author

Thomas Lange <[email protected]>

From fai-client 6.4.3 in Debian 13 (Trixie). Parsed by carta from the page's man source.