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

Grep command unstable in the scripts #100

Open
vijaypolsani opened this issue Sep 21, 2021 · 6 comments
Open

Grep command unstable in the scripts #100

vijaypolsani opened this issue Sep 21, 2021 · 6 comments

Comments

@vijaypolsani
Copy link

Scripts seems to be using a wrong grep command and every operation of command line syntax.
Operating on: Terminal MAC OS BigSur 11.6
StopGap Fix: Move to the older TAG 64.1 of the codebase
HEAD detached at 590d849

usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]]
[-e pattern] [-f file] [--binary-files=value] [--color=when]
[--context[=num]] [--directories=action] [--label] [--line-buffered]
[--null] [pattern] [file ...]
usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]]
[-e pattern] [-f file] [--binary-files=value] [--color=when]
[--context[=num]] [--directories=action] [--label] [--line-buffered]
[--null] [pattern] [file ...]
usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]]
[-e pattern] [-f file] [--binary-files=value] [--color=when]
[--context[=num]] [--directories=action] [--label] [--line-buffered]
[--null] [pattern] [file ...]
usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]]
[-e pattern] [-f file] [--binary-files=value] [--color=when]
[--context[=num]] [--directories=action] [--label] [--line-buffered]
[--null] [pattern] [file ...]

The default interactive shell is now zsh.
To update your account to use zsh, please run chsh -s /bin/zsh.
For more details, please visit https://support.apple.com/kb/HT208050.

@diogocavilha
Copy link
Owner

diogocavilha commented Sep 21, 2021

Hi, @vijaypolsani

Does it happen when you type some specific command?
Could you please share a screenshot of it?

@diogocavilha
Copy link
Owner

Hello, @vijaypolsani.

I hope you're doing good.

Does that problem you mentioned still remains?

@bobsc
Copy link

bobsc commented Apr 12, 2022

This happens because the grep command on MacOSX does not support -P (perl-regex) . I fixed it on mine by using a different method to get the information. For example, in settings-manager.sh:
# current_setting_value=$(grep -oP "(?<=$param_setting_name:).*" < "$FANCYGIT_CONFIG_FILE")
current_setting_value=$(git config --list | grep $param_setting_name: "$FANCYGIT_CONFIG_FILE"| cut -d ":" -f 2)

Here are all the offending lines:
.fancy-git/alias_functions/guser.sh:9:# guser=$(git config --list | grep -oP '(?<=user.name=).')
.fancy-git/alias_functions/guser.sh:10:# gemail=$(git config --list | grep -oP '(?<=user.email=).
')
.fancy-git/alias_functions/gpsob.sh:8:branch_name=$(git branch | grep -oP '(?<=* ).')
.fancy-git/alias_functions/gplob.sh:13: branch_name=$(git branch | grep -oP '(?<=* ).
')
.fancy-git/alias_functions/grba.sh:15:old_branch_name=$(git branch | grep -oP '(?<=* ).')
.fancy-git/alias_functions/gg.sh:10:#branch_name=$(git branch | grep -oP '(?<=* ).
')
.fancy-git/modules/settings-manager.sh:41:# current_setting_value=$(grep -oP "(?<=$param_setting_name:).*" < "$FANCYGIT_CONFIG_FILE")

@alexZaicev
Copy link

Same issue is present when I tried to install on MacOSX 😢

@ugmurthy
Copy link

ugmurthy commented Dec 7, 2022

I am having the same issue on MacOSX and have decided to uninstall it. However it works well for me on my Linux laptop as well as raspberry pi

Hope there is a fix for Mac

@monicaluodialpad
Copy link

Having the same issue on MacOS 14.2

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

No branches or pull requests

6 participants