From 5a0c8d6619e74f76d41a783d21cdb4d99d286718 Mon Sep 17 00:00:00 2001 From: Michael Pilosov <40366263+mathematicalmichael@users.noreply.github.com> Date: Wed, 4 Sep 2019 15:04:10 -0400 Subject: [PATCH] avoid "-bash: [: -gte: binary operator expected" Error while preserving functionality --- Examples.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Examples.md b/Examples.md index 1788c2c..380b747 100644 --- a/Examples.md +++ b/Examples.md @@ -290,7 +290,7 @@ ag --nobreak --nonumbers --noheading . | fzf # using ripgrep combined with preview # find-in-file - usage: fif fif() { - if [ ! "$#" -gte 1 ]; then echo "Need a string to search for!"; return 1; fi + if [ ! "$#" -gt 0 ]; then echo "Need a string to search for!"; return 1; fi rg --files-with-matches --no-messages "$1" | fzf --preview "highlight -O ansi -l {} 2> /dev/null | rg --colors 'match:bg:yellow' --ignore-case --pretty --context 10 '$1' || rg --ignore-case --pretty --context 10 '$1' {}" } ```