Phil Sutter dixit:

>cp .config .config.old
>ed -s .config <<EOF
>/# FWRT_FOO/s/^# \(.*\) is.*/\1=y/
>/FWRT_BAR/s/\(.*\)=.*/# \1 is not set/

/# FWRT_FOO/s/^# \(.*\) is.*$/\1=y/
/FWRT_BAR/s/^\(.*\)=.*$/# \1 is not set/

>...
>wq
>EOF
>
>this should better match the config syntax.

True, my bad.

>Is it possible with `ed' to
>insert text in case of failing searches?

No, but we can check for ed failures and just remove the config
or add text then. But IMHO in that case you're seriously fsck'd
up anyway.

Oh, please, don't (ab)use the ` character (0x90) again.

bye,
//mirabile
-- 
I believe no one can invent an algorithm. One just happens to hit upon it
when God enlightens him. Or only God invents algorithms, we merely copy them.
If you don't believe in God, just consider God as Nature if you won't deny
existence.              -- Coywolf Qi Hunt
_______________________________________________
freewrt-developers mailing list
[email protected]
https://www.freewrt.org/lists/listinfo/freewrt-developers

Reply via email to