Invoking grep in Perl mode requires JIT'ing the Perl regex.
This can run into issues with SELinix policy which will generally try to
limit use of execmem in general purpose scripts. This occurs since the
JIT'd code will live in executable memory.
The PCRE only '\K' command in the Perl REGEX can be replaced by a call
to awk instead.
local _out
if [[ $get_maj_min_cache_file ]]; then
- _out="$(grep -m1 -oP "^$1 \K\S+$" "$get_maj_min_cache_file")"
+ _out="$(grep -m1 -oE "^$1 \S+$" "$get_maj_min_cache_file" | awk '{print $NF}')"
fi
if ! [[ "$_out" ]]; then