NicolasWebDev / reinstall-magisk-on-lineageos

Small bash script to reinstall magisk after each LineageOS update
75 stars 16 forks source link

grep `--perl-regexp` unrecognized option on MacOS #15

Closed darthr4v3m closed 2 years ago

darthr4v3m commented 2 years ago

It looks like that the version of grep shipped on MacOS doesn't support this options.

MacOS version: 12.6 (21G115) grep shipped version: grep (BSD grep, GNU compatible) 2.6.0-FreeBSD

I find two possible solution.

Use --extended-regexp instead of --perl-regexp. Pros: uses shipped grep. Cons: regex need to be changed.

Install GNU grep (e.g. with Homebrew). Pros: regex remains the same. Cons: installation of new command.

https://github.com/NicolasWebDev/reinstall-magisk-on-lineageos/blob/315e837cb7a92c2fa57938940328cb7dcb4980f1/reinstall-magisk-on-lineageos#L32

NicolasWebDev commented 2 years ago

Fixed in commit 1d77e3ac69e79b36a7232573c1523a4ee9953dab.

Thank you for making the script more portable.