Last active
August 29, 2015 13:56
-
-
Save raphink/9278926 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use Config::Augeas; | |
use warnings; | |
use strict; | |
my $aug_root = '/home/rpinson/bas/augeas'; | |
my $aug = Config::Augeas->new(root => $aug_root); | |
$aug->set('/augeas/load/Simplelines/incl[last()+1]', '/users'); | |
$aug->load(); | |
# Define a variable called $nomatches which points to /files/users only if user "shanw" is not present | |
$aug->defvar(nomatches => '/files/users[count(*[.="shanw"])=0]'); | |
# This won't do anything if $nomatches doesn't point to the file | |
$aug->set('$nomatches/01', 'shanw'); | |
$aug->save(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment