(Copying the commit message below for more context)
On macOS, the default awk and sed are the BSD versions, which aren't
compatible with some of the flags used in fzf-bash-completion.sh. GNU
coreutils can be installed, but by default the GNU commands will be
prefixed with "g" to avoid breaking anything that depends on the BSD
versions.
If gawk/gsed are available, prefer them over awk and sed. This adds
basic support for MacOS if the user has the GNU tools installed. We
could do one better by using appropriate flags depending on the
BSD/GNU version, but this is way quicker to implement and works fine
for me.
Note - this only adds bash support, it doesn't add the equivalent gawk
fix for zsh.
Hey @lincheney, thanks for building this! I just used it for the first time and it looks pretty useful.
I had to do the same gawk/gsed fix mentioned in https://github.com/lincheney/fzf-tab-completion/issues/28#issuecomment-757622797 to get this running on macos, so figured I would PR it. Feel free to ignore if you don't want to support mac - happy to use my fork.
(Copying the commit message below for more context)
On macOS, the default awk and sed are the BSD versions, which aren't compatible with some of the flags used in fzf-bash-completion.sh. GNU coreutils can be installed, but by default the GNU commands will be prefixed with "g" to avoid breaking anything that depends on the BSD versions.
If gawk/gsed are available, prefer them over awk and sed. This adds basic support for MacOS if the user has the GNU tools installed. We could do one better by using appropriate flags depending on the BSD/GNU version, but this is way quicker to implement and works fine for me.
Note - this only adds bash support, it doesn't add the equivalent gawk fix for zsh.