[wplug] sed kung-fu and the art of kickstart file maintenance

Gabriel L. Somlo gsomlo at gmail.com
Thu Mar 3 13:05:33 EST 2011


> sed -i 's/\[section_title\]/cat/e' /etc/configfile.conf <<EOT
> [section_title]
>  foo
>  bar
>  blah
> EOT

After RTFM-ing a bit on the googlenets, I learned that the 'r' command
has a special file name, '/dev/stdin' which makes the end result look
something like this:

sed -i '/\[section_title\]/ r /dev/stdin' /etc/configfile.conf <<EOT
  foo
  bar
  blah
EOT

which is exactly what I was looking for.

Happy hacking,
--Gabriel


More information about the wplug mailing list