Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Fix funcoeszz when using apple's sed #39781

Closed
wants to merge 1 commit into from

Conversation

jaysonsantos
Copy link
Contributor

This software requires gnu-sed, so I've changed it to use explicitly gsed instead of apple's sed. With this you don't have to force users changing their paths to make gnu-sed default.

This software requires gnu-sed, so I've changed it to use explicitly gsed instead of apple's sed. With this you don't have to force users changing their paths to make gnu-sed default.
@MikeMcQuaid
Copy link
Member

Can you elaborate on how it requires it to work? Also, can you file an issue upstream asking if they can support BSD sed? Thanks!

@jaysonsantos
Copy link
Contributor Author

It fails when executing something like this set | sed -n '/^zz[a-z0-9]/ s/ *().*//p' but with gsed the same statement works set | gsed -n '/^zz[a-z0-9]/ s/ *().*//p'.

@MikeMcQuaid
Copy link
Member

@jaysonsantos Can you give an example of how to run that? I'm not sure I totally understand from the comment. Thanks!

@jaysonsantos
Copy link
Contributor Author

Install the current version on homebrew's master and run this:

export ZZPATH="/usr/local/opt/funcoeszz/funcoeszz.sh"
source "$ZZPATH"
zzzz

You will see the sed error.

@DomT4
Copy link
Member

DomT4 commented May 26, 2015

I didn't get as far as zzzz using the system sh.

Current:

sh-3.2$ export ZZPATH="/usr/local/opt/funcoeszz/funcoeszz.sh"
sh-3.2$ source "$ZZPATH"
sh: /usr/local/opt/funcoeszz/funcoeszz.sh: line 1862: syntax error near unexpected token `('
sh: /usr/local/opt/funcoeszz/funcoeszz.sh: line 1862: `             paste -d"|" <(echo "$vartemp"|cut -f1 -d:|sed 's/^[[:space:]]\+//g;s/[[:space:]]\+$//g') <(echo "$vartemp"|cut -f2- -d:|sed 's/^[[:space:]]\+//g')|'

New:

sh-3.2$ source "$ZZPATH"
sh: /usr/local/opt/funcoeszz/funcoeszz.sh: line 1862: syntax error near unexpected token `('
sh: /usr/local/opt/funcoeszz/funcoeszz.sh: line 1862: `             paste -d"|" <(echo "$vartemp"|cut -f1 -d:|gsed 's/^[[:space:]]\+//g;s/[[:space:]]\+$//g') <(echo "$vartemp"|cut -f2- -d:|gsed 's/^[[:space:]]\+//g')|'

If I use a modern Bash, via Homebrew in this case, I get no errors at all with either BSD sed or GNU sed.

@MikeMcQuaid
Copy link
Member

Looks like this needs a Requirement on a newer bash instead.

@DomT4
Copy link
Member

DomT4 commented May 27, 2015

CC @jaysonsantos. Can you switch to a recent bash and see if the sed error fails to reproduce for you as well? If it does, tweaking this PR to require Homebrew's bash would be great, and perhaps a small caveat warning of problems against the system sh. Thanks!

@DomT4
Copy link
Member

DomT4 commented Jun 3, 2015

Ping.

@DomT4 DomT4 closed this in 17a37c1 Jun 10, 2015
@Homebrew Homebrew locked and limited conversation to collaborators Jul 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants