Re: [PATCH 22/22] ver_linux: proc/modules, limit text processing to 'sed'

Alexander Kapshuk
2015-10-13T17:34:27Z

On Mon, Oct 12, 2015 at 11:22 PM, Jim Davis <jim.epost@gmail.com> wrote:
> On Mon, Oct 12, 2015 at 11:40 AM, Alexander Kapshuk
> <alexander.kapshuk@gmail.com> wrote:
>> This patch is more of a personal preference, rather than a fix for a problem.
>
> Using the sed hold space isn't exactly easy to follow... if, unlike
> the other patches, there isn't some potential improvement over the
> status quo I'd suggest sticking with the original version.
>
> --
> Jim

Thanks for your feedback.

If the use of a shell variable to store the generated list of modules
be deemed more favourable than the use of the 'sed' hold space, may I
at least suggest either of the two approaches below:

Sorted list:
Y=`sort /proc/modules | sed 's/ .*$//'`

Unsorted list:
Z=`sed 's/ .*$//' /proc/modules`

The use of 'cat' in the context of the original implementation is redundant.