jonnyboy/newznab-tmux — pull request #37 by jozzfest (2013-01-11 04:23:14+00:00)
Title: Updating the tmux scripts to make the sed binary modular 

Reference https://github.com/jonnyboy/newznab-tmux/issues/23

FreeBSD doesn't have GNU sed installed by default as the binary 'sed'

As a result, most of the tmux scripts all start with sed errors and are unable to parse the newznab config. This text is present when running the scripts out of the box on FreeBSD:
"extra characters at the end of p command"

I propose modifying all sed commands to execute via a variable ($SEDCMD) defined in edit_these.sh. It has a default of /bin/sed which is the standard location for RHEL and Ubuntu with an optional (commented out) line for the FreeBSD default /usr/local/bin/gsed.

If you're running FreeBSD you'll have to install GNU sed via the FreeBSD ports tree in /usr/ports/textproc/gsed, and then modify the SEDCMD setting in edit_these.sh before running set_perms.sh and start.sh.

This could also be scoped out to test for the existence of gsed and then set the variable accordingly. But at least as a proof of concept, setting it manually works.