gpt3-cli
gpt3-cli copied to clipboard
Ensure GNU sed works like BSD sed
Before this change, the script would fail on Linux, with a sed error
According to the Linux man page, -u causes sed to flush its buffers more often.
In my experience, this is the option to use to get realtime streaming output from sed. (It's the closest thing to line-buffering.)
This manpage says the BSD version of sed also accepts the -u argument. man page
In which case the simplest solution would just be to use -u instead of -l without any checking.
However, I'm not convinced that all Macs have that version of sed.