Ask Your Question

Revision history [back]

Hi,

Actually, you have multiple ways to do it, depending on what you really want to do.

First, you can use templates or static file resources which you already know.

Secondly, you can use the concat module so you can order bunch of texts/lines the way you want.

If you want to be more granular, you can use the file_line function so you can add/replace lines according to conditions like:

"add this line after the following line, etc...".

I don't suggest augeas as it works better with files with sections in it (obviously, that's not the case for /etc/services).

Check each one of these choices and choose the one that meets the best your requirements.

Regards, Rudy