by 1MachineElf · 6y ago · 0 comments
For the year prior to this one, I had FreeBSD in almost the same configuration running on a Raspberry Pi (1!!!) B.
Both were rock solid stable without any serious problems, but in the end, I favored the OpenBSD/Beaglebone more. The sole reason for this is the strange behavior I encountered on FreeBSD while using vi over a serial connection - all of vi would appear in the serial console as a single line. I believe it was a known bug at the time. This made vi unusable, and I had to resort editing the firewall confgs line by line using sed and cat (FreeBSD sed doesn't have the in-place editing that GNU sed has). Quite a PITA.
FWIW, that's not correct. On BSD (incl macOS), the -i option takes an argument for the file extension to use as a tmp file:
So for GNU sed:
sed -i 's/old/new/g' FILE
Translates to BSD sed as: sed -i '' 's/old/new/g' FILE
It is not recommended to use an empty string as the extension, but as long as your sed command does not fail due to disk space etc, it is fine.Also, GNU sed takes an extension argument too, but it is optional:
sed -iEXT 's/old/new/g' FILEThis was from 5 years ago. I believe I found a discussion online somewhere that touched upon the issue. Today, the closest thing I can find is this bug on pfSense: https://redmine.pfsense.org/issues/9569