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

Portability fix: Avoid the use of sed -r #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fumiyas
Copy link
Contributor

@fumiyas fumiyas commented Jun 28, 2019

Legacy sed does not support -r option (use extended regular expressions)

Legacy sed does not support -r option (use extended regular expressions)
@schmonz
Copy link

schmonz commented Jan 25, 2020

Another option: according to GNU sed's manpage, -E is the POSIX-specified and portable synonym for -r. This seems to work for me on a bunch of platforms:

@@ -20,8 +20,8 @@ svpid=$!
 waitok test.sv

 svstat test.sv \
-| sed -r 's, \(.+\),,' \
-| sed -r 's, ([0-9]|1[0-9]) second.+$, ok,'
+| sed -E 's, \(.+\),,' \
+| sed -E 's, ([0-9]|1[0-9]) second.+$, ok,'

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