replacing with "is not set"

replacing with "is not set"

am 05.10.2007 19:29:11 von onkar

# CONFIG_DVB_SP8870=m
# CONFIG_DVB_SP887X=m
# CONFIG_DVB_CX22700=m
# CONFIG_DVB_CX22702=m
# CONFIG_DVB_L64781=m
# CONFIG_DVB_TDA1004X=m
# CONFIG_DVB_NXT6000=m
# CONFIG_DVB_MT352=m
# CONFIG_DVB_ZL10353=m
# CONFIG_DVB_DIB3000MB=m
# CONFIG_DVB_DIB3000MC=m
# CONFIG_DVB_DIB7000M is not set
# CONFIG_DVB_DIB7000P is not set

This is a part of the Linux configuration file. There are number of
such configuration options that I have commented ; but they also need
be appended with "is not set"

that is

# CONFIG_DVB_SP8870=m

must be

# CONFIG_DVB_SP8870 is not set



in vi editor I tried to replace by using

:%s/???/***/gc

Please give me regex at ??? and *** place




Thanks
Onkar

Re: replacing with "is not set"

am 05.10.2007 20:30:44 von Brian Mac

On Oct 5, 1:29 pm, onkar wrote:
> # CONFIG_DVB_SP8870=m
> # CONFIG_DVB_SP887X=m
> # CONFIG_DVB_CX22700=m
> # CONFIG_DVB_CX22702=m
> # CONFIG_DVB_L64781=m
> # CONFIG_DVB_TDA1004X=m
> # CONFIG_DVB_NXT6000=m
> # CONFIG_DVB_MT352=m
> # CONFIG_DVB_ZL10353=m
> # CONFIG_DVB_DIB3000MB=m
> # CONFIG_DVB_DIB3000MC=m
> # CONFIG_DVB_DIB7000M is not set
> # CONFIG_DVB_DIB7000P is not set
>
> This is a part of the Linux configuration file. There are number of
> such configuration options that I have commented ; but they also need
> be appended with "is not set"
>
> that is
>
> # CONFIG_DVB_SP8870=m
>
> must be
>
> # CONFIG_DVB_SP8870 is not set
>
> in vi editor I tried to replace by using
>
> :%s/???/***/gc
>
> Please give me regex at ??? and *** place
>
> Thanks
> Onkar

hi onkar,

if you want to add the text 'is not set' to all lines that begin with
a comment you could use something like this....

%s/^#.*$/& is not set/

that will match the pattern and throw 'is not set' after the pattern
is matched - in this case after the end-of-line anchor.

hope this helps,
brian

Re: replacing with "is not set"

am 05.10.2007 21:50:06 von Janis Papanagnou

onkar wrote:
> # CONFIG_DVB_SP8870=m
> # CONFIG_DVB_SP887X=m
> # CONFIG_DVB_CX22700=m
> # CONFIG_DVB_CX22702=m
> # CONFIG_DVB_L64781=m
> # CONFIG_DVB_TDA1004X=m
> # CONFIG_DVB_NXT6000=m
> # CONFIG_DVB_MT352=m
> # CONFIG_DVB_ZL10353=m
> # CONFIG_DVB_DIB3000MB=m
> # CONFIG_DVB_DIB3000MC=m
> # CONFIG_DVB_DIB7000M is not set
> # CONFIG_DVB_DIB7000P is not set
>
> This is a part of the Linux configuration file. There are number of
> such configuration options that I have commented ; but they also need
> be appended with "is not set"
>
> that is
>
> # CONFIG_DVB_SP8870=m
>
> must be
>
> # CONFIG_DVB_SP8870 is not set
>
>
>
> in vi editor I tried to replace by using
>
> :%s/???/***/gc
>
> Please give me regex at ??? and *** place

Very simplistic that would be

:%s/=m$/ is not set/

But maybe you like to substitute only lines matching some pattern

:g/^# CONFIG_DVB_/s/=m$/ is not set/


Janis

>
>
>
>
> Thanks
> Onkar
>