fai-sed(1)

πŸ“¦
version 6.6ubuntu1 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’… fai-sed β€” the manual page, but make it cute

okay bestie, welcome to fai-sed πŸ’– this is from the General Commands Manual section, and honestly? it's giving "responsible little helper who refuses to touch your file for no reason." iconic behavior fr fr.


🌸 NAME 🌸

fai-sed β€” call sed on a file but check for changes before writing ✨


πŸŽ€ SYNOPSIS πŸŽ€

fai-sed CMD FILE

πŸ’« DESCRIPTION πŸ’«

So here's the vibe: you run a sed script β€” we're calling that script CMD in here β€” on FILE. But!!! it does not overwrite the file if nothing changes. Like, if your sed did absolutely nothing? no write. no timestamp drama. the file stays untouched. periodt. πŸ’…

If $target is defined, use it as the prefix for the path to FILE. yes literally as a prefix, that's the whole rule 🫢

Exit status 0 means success, bestie πŸŽ‰ a nonzero value means failure 😭 (that's the entire definition of the two, no cap).


✨ OPTIONS ✨

  • -E β€” if fai-sed changed the file, exit with 9 instead of 0. yes it's a lil unhinged. it's also exactly what it does πŸ’…
  • -n β€” dry run 🧚 it prints whether the file would have changed, but does not change it. nothing gets touched. main character observation-only energy πŸ‘‘

🌈 EXAMPLES 🌈

okay let's see her in action:

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

Replace foo with bar in the file /etc/motd. slay πŸ“

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

Replace 123 with ABC and delete all the lines that contain the string XXX. two jobs, one command, she ate πŸ”₯


πŸ” 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@cs.uni-koeln.de> πŸ’œ


that's the whole page, bestie β€” no notes, no skips, every flag accounted for 🌸 and a lil sign-off: this beauty is FAI 5, dated 2020, and she has been serving correct sed behavior ever since πŸ’–βœ¨πŸ«Ά