1

Suppose I have fstab-like 2-dimensional white-space separated table (in my case it is /etc/lxc/lxc-usernet), with the following typical contents:

# USERNAME TYPE BRIDGE COUNT
adam veth lxcbr0 10
tempuser veth lxcbr1 5

How to edit it with augeas? I don't need to address the fields by name, they can be addressed by index if that helps.

Adam Ryczkowski
  • 7,592
  • 13
  • 42
  • 68

1 Answers1

0

You will need to write a lens for this. The best option is to copy the Fstab module and adjust the fields.

You could also do some simpler, along the lines of (adapt field labels):

module LXC_usernet =

let entry = [ seq "entry"
            . [ label "name" . store Rx.word ] . Sep.space
            . [ label "type" . store Rx.word ] . Sep.space
            . [ label "dev" . store Rx.word ] . Sep.space
            . [ label "value" . store Rx.word ] . Util.eol ]

let lns = (Util.empty | Util.comment | entry)*
raphink
  • 3,625
  • 1
  • 28
  • 39