[Ilugc] using sed [SOLVED]

  • From: binand@xxxxxxxxx (Binand Sethumadhavan)
  • Date: Wed Apr 5 11:52:43 2006

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

It worked at last !. The command is,

 export B=`grep -n -F "[xdmcp]" /etc/X11/gdm/gdm.conf | awk -F: '{print
$1}'` | sed -e ''"$B"',190 s/Enable=.*/Enable=true/;' /etc/X11/gdm/gdm.conf
gdm.new

Wow - that looks ugly and fragile :) Have you considered using perl?
There are several modules on CPAN that parses config files of this
type (several [sections] with name=value settings).

Binand

Other related posts: