Re: [LAU] How to post selected contend of a configuration file Was: OT - Re: Kernel 2.6.39 Re: Linux-audio-user Digest, Vol 52, Issue 33

From: S C Rigler <riglersc@email-addr-hidden>
Date: Thu Jun 23 2011 - 16:52:39 EEST

On Thu, Jun 23, 2011 at 7:53 AM, Ralf Mardorf
<ralf.mardorf@email-addr-hidden-dsl.net> wrote:
> $ less config-2.6.39.1 | grep PREEMPT
> CONFIG_TREE_PREEMPT_RCU=y
> CONFIG_PREEMPT_RCU=y
> CONFIG_PREEMPT_NOTIFIERS=y
> # CONFIG_PREEMPT_NONE is not set
> # CONFIG_PREEMPT_VOLUNTARY is not set
> CONFIG_PREEMPT=y
>
> Is this better? Any thing that will replace 'grep'?
>

Grep is fully capably capable of matching lines directly from the file
so you don't need anything piping the file to it. You would only need
to use "less" in this context if you expected the number of matches
from "grep" to exceed your console size and wanted to page through
them ("grep PREEMPT /boot/config* | less").

> Could there be any advantages for me not
> using cat?

You probably won't notice on simple one-liners, but it's bad practice
and will lead to bad scripting. If you write a script with a bunch of
useless "cat's" in it you will notice a *significant* performance hit
when compared to a script that properly uses shell built-ins, etc.

--Steve
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-user
Received on Thu Jun 23 20:15:03 2011

This archive was generated by hypermail 2.1.8 : Thu Jun 23 2011 - 20:15:04 EEST