/egrep/grep -E/

Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
Steven Armstrong 2012-02-08 08:31:59 +01:00
parent ef81f03e89
commit 817ce9c256

View file

@ -29,7 +29,7 @@ value="$(cat "$__object/parameter/value" 2>/dev/null \
case "$state" in
absent)
if egrep -q "^$key$delimiter+" "$file"; then
if grep -q -E "^$key$delimiter+" "$file"; then
# if the key exists, with whatever value, we will have to remove it
# so report it as present
echo present
@ -39,10 +39,10 @@ case "$state" in
fi
;;
present)
if egrep -q "^$key$delimiter+$value$" "$file"; then
if grep -q -E "^$key$delimiter+$value$" "$file"; then
# key exists and value is same
echo present
elif egrep -q "^$key$delimiter+" "$file"; then
elif grep -q -E "^$key$delimiter+" "$file"; then
# key exists, but value is empty or different
echo wrongvalue
else