[prev in list] [next in list] [prev in thread] [next in thread] 

List:       libvir-list
Subject:    Re: [libvirt PATCH 03/19] commandhelper: Simplify envsort
From:       Peter Krempa <pkrempa () redhat ! com>
Date:       2021-01-29 16:50:39
Message-ID: 20210129165039.GU6906 () angien ! pipo ! sk
[Download RAW message or body]

On Fri, Jan 29, 2021 at 17:16:13 +0100, Tim Wiederhake wrote:
> Comparing only the keys produces the same result as comparing keys and
> value. The latter saves two invocations of each `strndup` and `free`.

env variable names allow also ascii chars with lower index than '=' such
as numbers:

$ TEST=asdf TEST1=asdf env | grep TEST | LANG=C sort
TEST1=asdf
TEST=asdf
$ TEST=asdf TEST1=asdf env | grep TEST | cut -d "=" -f 1 | LANG=C sort
TEST
TEST1

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic