@nixCraft The example with cat is less efficient (one extra process), but it is more composable (if you wanted to put something before the grep, you could)
One of the most fundamental yet little-known features of FreeBSD is its ability to be used in read-only mode very easily. By installing the system on a UFS file system, you just need to modify the fstab file, change "rw" to "ro," and reboot. On the next boot, the system will automatically create mount points in RAM for the main directories (/tmp, log, etc.), and it will run perfectly.
This was the main reason why, many years ago, I chose FreeBSD for almost all my embedded systems. Even today, on my Raspberry Pies, I keep the SD cards in read-only mode and use external storage in read-write mode. This ensures that, in case of an unexpected poweroff, the system will come back up, and there will be no wear on the memory card.
I've been meaning to do this for a while, and tonight I finally supported @mwl for his new book: Run Your Own Mail Server: A Book for Independence & Privacy
Every book I've read by mwl has gifted me with smiles, laughter, knowledge, awareness, and a desire to experiment.
Can't wait to dive into this new work!
2024-06-15: CfP closes (BSDCan closes on 2024-06-01)
2024-06-22: PC finalizes speaker selection
2024-06-31: Early Bird closes
2024-07-15: Schedule published
2024-09-19—22: EuroBSDCon 2024 in Dublin