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: Invalid range end; syntax error near unexpected token `newline' #11

Closed
city41 opened this issue Sep 21, 2019 · 3 comments
Closed

Comments

@city41
Copy link

city41 commented Sep 21, 2019

I see these two errors back to back after ever command I try.

repro:

  1. invoke navi while in a directory that has a git repo
  2. type git check
  3. choose git checkout <branch> [git]

result:

22:20 $ navi
grep: Invalid range end
/opt/navi/src/main.sh: eval: line 35: syntax error near unexpected token `newline'

get the same result if I choose # Checkout to branch [git], or any other option at all such as netstat ..., tar xf <tar_file>, etc

environment:

OS: Ubuntu 18.04.3
shell: GNU bash, version 4.4.20(1)-release (x86_64-pc-linux-gnu)
grep: grep (GNU grep) 3.1
fzf: 0.18.0 (ff95134)

I noticed in the README mention of brew. is it possible this tool was built to run with BSD grep?

btw, this tool looks great! I've always wanted to make something very much like this. Thanks for building it!

@welcome
Copy link

welcome bot commented Sep 21, 2019

Thanks for opening your first issue here!

@city41
Copy link
Author

city41 commented Sep 21, 2019

Running the local IP address command does print my IP address, but also prints grep: Invalid range end. It does not emit the error coming from main.sh though.

@city41
Copy link
Author

city41 commented Sep 21, 2019

navi works correctly if I use busybox grep (noticed the demo was using it), so it does seem like it has problems with gnu grep.

What I did was sudo mv /bin/grep /bin/grep.real && sudo ln -s /bin/busybox /bin/grep and after that navi works great.

I don't plan to keep busybox grep, just doing this as a test.

EDIT: I replaced all calls to grep with busybox grep in navi's src files and now it works great. Probably not a long term solution, but good for now. I'm not having much luck yet learning what would be needed to get navi compatible with both bsd and gnu grep

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

2 participants