Skip to content
Snippets Groups Projects
Commit 535723f9 authored by Jörg Sachse's avatar Jörg Sachse
Browse files

fix: handle UTF-8 files correctly when choosing between grep/zgrep

parent f008c040
No related branches found
No related tags found
No related merge requests found
......@@ -147,8 +147,10 @@ get_last_n_days(){
GREP_CMD="zgrep"
elif file -b "${LOGFILE}" | grep "ASCII text" > /dev/null; then
GREP_CMD="grep"
elif file -b "${LOGFILE}" | grep "UTF-8 Unicode text" > /dev/null; then
GREP_CMD="grep"
else
>&2 echo "ERROR: unknown filetype, cannot find error strings from file '${LOGFILE}.'"
>&2 echo "ERROR: unknown filetype, cannot find error strings from file '${LOGFILE}'."
fi
${GREP_CMD} -oP "${FILTER_STRING}" "${LOGFILE}"
done | \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment