logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

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

Author

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

FAI 5                                                 2020                                            fai-sed(1)

Description

       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.

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.

Name

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

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.

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.

Synopsis

fai-sed CMD FILE

return

See Also