mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-04-18 06:29:39 +02:00
Better handling around grep/awk
This commit is contained in:
committed by
Lukas Schauer
parent
6ee4ae508e
commit
71f6bc617e
@@ -88,7 +88,7 @@ jsonsh() {
|
|||||||
awk_egrep () {
|
awk_egrep () {
|
||||||
local pattern_string=$1
|
local pattern_string=$1
|
||||||
|
|
||||||
gawk '{
|
awk '{
|
||||||
while ($0) {
|
while ($0) {
|
||||||
start=match($0, pattern);
|
start=match($0, pattern);
|
||||||
token=substr($0, start, RLENGTH);
|
token=substr($0, start, RLENGTH);
|
||||||
@@ -110,7 +110,7 @@ jsonsh() {
|
|||||||
GREP='egrep -ao'
|
GREP='egrep -ao'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if echo "test string" | egrep -o "test" >/dev/null 2>&1
|
if echo "test string" | egrep -ao "test" >/dev/null 2>&1
|
||||||
then
|
then
|
||||||
ESCAPE='(\\[^u[:cntrl:]]|\\u[0-9a-fA-F]{4})'
|
ESCAPE='(\\[^u[:cntrl:]]|\\u[0-9a-fA-F]{4})'
|
||||||
CHAR='[^[:cntrl:]"\\]'
|
CHAR='[^[:cntrl:]"\\]'
|
||||||
|
|||||||
Reference in New Issue
Block a user