busybox grep only supports the short option -a --- a/src/logcheck +++ b/src/logcheck @@ -242,7 +242,7 @@ cleanrules() { if [ -f "${dir}/${rulefile}" ]; then debug "cleanrules: ${dir}/${rulefile} -> $cleaned/$rulefile" # pipe outut of 'grep' to 'cat' because we want a exit status of 0 even if grep did not find matches - command grep -E --text -v '^[[:space:]]*$|^#' "$dir/$rulefile" \ + command grep -E -a -v '^[[:space:]]*$|^#' "$dir/$rulefile" \ | cat >> "$cleaned/$rulefile" \ || error "Could not append to $cleaned/$rulefile" fi @@ -361,7 +361,7 @@ greplogoutput() { debug "greplogoutput: Using $grepfile to find entries to report" "$grepfile" # Report entries that match - command grep -E --text -f "$grepfile" "$TMPDIR/logoutput-sorted" \ + command grep -E -a -f "$grepfile" "$TMPDIR/logoutput-sorted" \ | cat > "$TMPDIR/checked" \ || error "Could not output to $TMPDIR/checked" @@ -456,7 +456,7 @@ cleanchecked() { if [ -f "$clean" ]; then debug "cleanchecked - filtering using file: $clean" "$clean" - command grep -E --text -v -f "$clean" "$TMPDIR/checked" \ + command grep -E -a -v -f "$clean" "$TMPDIR/checked" \ | cat >> "$TMPDIR/checked.1" \ || error "Could not output to $TMPDIR/checked.1" debug "cleanchecked - after using $clean remaining lines are as follows:" "$TMPDIR/checked.1" @@ -757,7 +757,7 @@ if [ -z "${LOGFILE-}" ] && [ "${#LOGFILES[@]}" != "0" ]; then for file_list in "${LOGFILES[@]}" ; do if [ -f "$file_list" ] && [ -r "$file_list" ]; then SAVEIFS=$IFS; IFS=$(echo -en "\n\b"); - for file in $(command grep -E --text -v -h "(^#|^[[:space:]]*$)" "$file_list"); do + for file in $(command grep -E -a -v -h "(^#|^[[:space:]]*$)" "$file_list"); do logoutput "$file" done IFS=$SAVEIFS