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

scripts: use grep -E instead of egrep #9491

Closed
wants to merge 2 commits into from
Closed

Conversation

a1346054
Copy link
Contributor

@a1346054 a1346054 commented Sep 12, 2022

latest GNU grep emits a deprecation message when egrep is invoked. All platforms that can be expected to run the three changed scripts already have grep -E as a replacement.

MacOSX-Framework Outdated
OLD_SDK64=`ls $SDK_PATH|egrep -v "10.[0-4]"|head -1`
NEW_SDK64=`ls -r $SDK_PATH|egrep -v "10.[0-4][^0-9]" | head -1`
OLD_SDK64=`ls $SDK_PATH|grep -Ev "10.[0-4]"|head -1`
NEW_SDK64=`ls -r $SDK_PATH|grep -Ev "10.[0-4][^0-9]" | head -1`
Copy link
Contributor

@emanuele6 emanuele6 Sep 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need to use -E here

Copy link
Contributor Author

@a1346054 a1346054 Sep 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't want to change the script more than I had to.

Copy link
Member

@vszakats vszakats Sep 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strictly speaking, . should be escaped here as well. This, and dropping -E are fine within this PR IMO.

We have more egreps in this file:

.github/workflows/hacktoberfest-accepted.yml:            egrep -i "^Close[sd]? " | sort | uniq | tee log
.github/workflows/hacktoberfest-accepted.yml:          egrep -o "#([0-9]+)" log | cut -d# -f2 | sort | uniq | xargs -t -n1 -I{} \
.github/workflows/hacktoberfest-accepted.yml:            egrep -o '^([0-9]+):[0-9]{4}-(09-30T|10-|11-01T)' | cut -d: -f1 | sort | uniq | xargs -t -n1 -I {} \
.github/workflows/hacktoberfest-accepted.yml:          egrep -o "github.com/(.+)/(.+)/pull/([0-9]+)" log | sort | uniq | xargs -t -n1 -I{} \
.github/workflows/hacktoberfest-accepted.yml:            egrep -o '^([0-9]+):[0-9]{4}-(09-30T|10-|11-01T)' | cut -d: -f1 | sort | uniq | xargs -t -n1 -I {} \

Copy link
Contributor Author

@a1346054 a1346054 Sep 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed your comments in the fixed up commit.

@a1346054
Copy link
Contributor Author

a1346054 commented Sep 12, 2022

Fixed up the commit by removing -E where not needed for the grep pattern, and additionally escaping the . in the pattern.

Also replaced egrep in hacktoberfest-accepted.yml with grep -E

@bagder bagder closed this in c3a6165 Sep 13, 2022
@bagder
Copy link
Member

bagder commented Sep 13, 2022

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

4 participants