[augeas-devel] General Lens

Raphaël Pinson raphael.pinson at camptocamp.com
Mon Jun 25 17:29:56 UTC 2018


Hi Michael,


You can use Simplelines.lns for that.


Regards,

Raphaël

On Mon, Jun 25, 2018 at 7:15 PM, Michael Boldi <mboldi at uptycs.com> wrote:

> Hi,
> I was hoping to find a lens for a generic file like   /etc/motd  ..
> I need to look for certain illegal strings as well as verify some strings
> exist.
>
> I would imagine the key is line# and value would be the entire line ..
> I guess the lack of keys in the motd may prohibit this ?
>
> I wrote a simple ( lens creator newbie )   lens to do this ..
> Is this 2request worth submitting ?  Or can we introduce my simple lens
> into the library ?
>
> Here ..
>
> module Motd =
>   autoload xfm
>
> let word = /[^# \n\t\/]+/
>
> let sto_line = store /[^# \t\n].*$/
>
> let record = [ key word . (Util.del_ws_tab . sto_line)? . Util.eol ]
>
> let lns = ( Util.empty | Util.comment | record ) *
> let filter = (
>    incl "/etc/motd" .
>    incl "/etc/issue" .
>    incl "/etc/issue.net" )
> let xfm = transform lns filter
>
>
>
> _______________________________________________
> augeas-devel mailing list
> augeas-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/augeas-devel
>



-- 
Raphaël Pinson
Infrastructure Developer & Training Leader
+33 458 482 013

Camptocamp France SAS
Bâtiment le Dauphin - 1er étage
18 rue du Lac Saint André
Savoie Technolac
F-73370 Le Bourget du Lac

www.camptocamp.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20180625/c9da8c0a/attachment.htm>


More information about the augeas-devel mailing list