fai-sed

NAME
SYNOPSIS
DESCRIPTION
EXAMPLES
SEE ALSO
AUTHOR

NAME

fai-sed - call sed on a file but check for changes before writing

SYNOPSIS

fai-sed CMD FILE

DESCRIPTION

Execute sed command on a file but do not overwrite the file if nothing has changed. If $target is defined, use it as prefix for the path to FILE.

The exit code is 0 if no changes were done, 1 if the file was changed and exit codes greater 1 indicate errors.

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.

SEE ALSO

This program is part of FAI (Fully Automatic Installation). See the FAI manual for more information on how to use fai-monitor. The FAI homepage is https://fai-project.org.

AUTHOR

Thomas Lange <lange@informatik.uni-koeln.de>