Commit d5d079f2 authored by Vitaly Lipatov's avatar Vitaly Lipatov

tools_json: replace egrep with grep -E

parent ba7a55a9
......@@ -77,14 +77,14 @@ tokenize () {
local ESCAPE
local CHAR
if echo "test string" | egrep -ao --color=never "test" >/dev/null 2>&1
if echo "test string" | grep -E -ao --color=never "test" >/dev/null 2>&1
then
GREP='egrep -ao --color=never'
GREP='grep -E -ao --color=never'
else
GREP='egrep -ao'
GREP='grep -E -ao'
fi
if echo "test string" | egrep -o "test" >/dev/null 2>&1
if echo "test string" | grep -E -o "test" >/dev/null 2>&1
then
ESCAPE='(\\[^u[:cntrl:]]|\\u[0-9a-fA-F]{4})'
CHAR='[^[:cntrl:]"\\]'
......@@ -102,7 +102,7 @@ tokenize () {
# Force zsh to expand $A into multiple words
local is_wordsplit_disabled=$(unsetopt 2>/dev/null | grep -c '^shwordsplit$')
if [ $is_wordsplit_disabled != 0 ]; then setopt shwordsplit; fi
$GREP "$STRING|$NUMBER|$KEYWORD|$SPACE|." | egrep -v "^$SPACE$"
$GREP "$STRING|$NUMBER|$KEYWORD|$SPACE|." | grep -E -v "^$SPACE$"
if [ $is_wordsplit_disabled != 0 ]; then unsetopt shwordsplit; fi
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment