Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed sed replacement for OSX #2

Open
wants to merge 2 commits into
base: fix-upstream-script-1_6
Choose a base branch
from

Conversation

robertpanzer
Copy link

Learned sth new about sed! :)
Didn't know that ; can be used instead of / to separate elements.
The \+ doesn't match on my machine though.

Tested on OS X and on an Ubuntu Docker container.

mojavelinux and others added 2 commits August 2, 2015 03:09
- use old-fashioned sed update in place technique w/ tmp file
@mojavelinux mojavelinux force-pushed the fix-upstream-script-1_6 branch from 8c2979d to a52fce1 Compare August 3, 2015 03:31
@mojavelinux
Copy link
Owner

I replaced the plus with an asterisk as that's specific enough and should work fine. Can you check it?

@mojavelinux
Copy link
Owner

Didn't know that ; can be used instead of / to separate elements.

Actually, you can use any character.

@robertpanzer
Copy link
Author

Will test this evening, but I think it should work.
I just don't understand why it worked on Linux before.
Shouldn't \+ have matched a plus sign? And I can't find that in the 2 lines that should be edited.

@mojavelinux
Copy link
Owner

In sed on Linux it's backwards. The unescaped + is a literal plus and the escaped + means match 1 or more. It's that bizarre regex engine that's in vim at work. I've always found it best to avoid using that match operator in shell scripts and prefer just typing it out (like "aa*" instead of "a+").

@robertpanzer
Copy link
Author

Oh wow, just checked it on Ubuntu.
I didn't know that yet and I've been writing sed scripts on many platforms for years now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants