gpt3-cli icon indicating copy to clipboard operation
gpt3-cli copied to clipboard

Ensure GNU sed works like BSD sed

Open joeytwiddle opened this issue 2 years ago • 2 comments

Before this change, the script would fail on Linux, with a sed error

joeytwiddle avatar Mar 16 '23 06:03 joeytwiddle

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.)

joeytwiddle avatar Mar 16 '23 06:03 joeytwiddle

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.

joeytwiddle avatar Mar 16 '23 07:03 joeytwiddle