[Ovirt-devel] [PATCH 4/4] build-all.sh: Avoid unnecessary "grep" in IP-addr-extraction code

Chris Lalancette clalance at redhat.com
Mon Jun 16 07:11:45 UTC 2008


Jim Meyering wrote:
> diff --git a/build-all.sh b/build-all.sh
> index eb9c848..e681f18 100755
> --- a/build-all.sh
> +++ b/build-all.sh
> @@ -226,7 +226,8 @@ fi
>  # NOTE: create-wui-appliance.sh must be run as root
>  if [ $update_app == 1 ]; then
>      # FIXME: This can go away once we have livecd tools building the appliances
> -    VIRBR=$(virsh net-dumpxml default | grep "<ip address=" | sed "s/.*ip address='\(.*\)' .*/\1/")
> +    VIRBR=$(virsh net-dumpxml default \
> +	    | sed -n "s/.*ip address='\([^.]*\)' .*/\1/p")

This is fine, but maybe we should change also then change the sed part of it to
look for ".*<ip address='\([^.]*\)' .*" instead?  Not really a big deal anyway,
just a minor cleanup.

Chris Lalancette




More information about the ovirt-devel mailing list