replace egrep with awk functions

remotes/origin/4.0
Daniel Heule 9 years ago
parent 0179904675
commit d3a0bd20c0
  1. 4
      cdist/conf/type/__zypper_service/explorer/service_uri

@ -25,6 +25,4 @@ if [ -f "$__object/parameter/uri" ]; then
else
uri="/$__object_id"
fi
# simpler command which works only on SLES11 SP3 or newer:
# echo $(zypper ls -u -E | grep -E "\<$uri\>" | cut -d'|' -f 7)
echo $(zypper ls -u | grep -E '^([^|]+\|){3,3} Yes' | grep -E "\<$uri\>" | awk '{print $NF}')
echo $(zypper ls -u | awk 'BEGIN { FS = "[ ]+\\|[ ]+" } ; $4 == "Yes" && $NF == "'$uri'" {print $NF}')

Loading…
Cancel
Save