From: Harald Hoyer Date: Sat, 25 Feb 2012 15:08:30 +0000 (+0100) Subject: dracut-functions.sh: instmods(): replace egrep with shell code X-Git-Tag: 018~94 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86191581d125b1373532593371fde767a56728a0;p=thirdparty%2Fdracut.git dracut-functions.sh: instmods(): replace egrep with shell code --- diff --git a/dracut-functions.sh b/dracut-functions.sh index 9e9ee4e56..81801e145 100755 --- a/dracut-functions.sh +++ b/dracut-functions.sh @@ -1167,9 +1167,10 @@ instmods() { return $_ret } + local _filter_not_found='FATAL: Module .* not found.' # Capture all stderr from modprobe to _fderr. We could use {var}>... # redirections, but that would make dracut require bash4 at least. eval "( instmods_1 \"\$@\" ) ${_fderr}>&1" \ - | egrep -v 'FATAL: Module .* not found.' | derror + | while read line; do [[ "$line" =~ $_filter_not_found ]] || echo $line;done | derror return $? }