[Ilugc] using sed

  • From: gopal@xxxxxxxxxxxxxxxxx (Gopalarathnam Venkatesan)
  • Date: Tue Apr 4 17:45:37 2006

On 4/4/06, Chakkaradeep C C <chaks.yoper@xxxxxxxxx> wrote:

Hi all,

I want to change the line,

GraphicalTheme=Bluecurve

in gdm.conf to GraphicalTheme=<my-theme> using sed. How to achieve this?.

I tried, sed -e 's/GraphicalTheme=/GraphicalTheme=<my-theme>/ gdm.conf', but
the line does not change here.Only the pattern changes.

Thanks in advance.

The newer versions of sed (at least GNU sed) has the "change in place
feature" which is supported using the -i option.

Or, you can use:

shell> ed gdm.conf <<!
1,$s/Graphical Theme=Bluecurve/Graphical Theme=<my-theme>/g
w
q
!

HTH.


PS.
Read ed(1), sed(1).

--
Gopalarathnam Venkatesan
http://gopalarathnam.com/

Other related posts: