AUGPRINT(1) Augeas AUGPRINT(1) (NAME) augprint - (idempotent) augtool (SYNOPSIS) augprint [--pretty|-p] [--regexp[=n]|-r[n]] [--noseq|-s] [--verbose|-v] [--lens name|-l name] [--target /target|-t /target] FILE (DESCRIPTION) augprint augtool FILE "set" . (idempotent) . augprint (path-expression) . . <<>> . (Regexp output) augprint "=" : set /files/etc/hosts/seq::*[ipaddr='127.0.0.1']/ipaddr '127.0.0.1' --regexp : set /files/etc/hosts/seq::*[ipaddr=~regexp('127\\.0\\..*')]/ipaddr '127.0.0.1' N "--regexp=N" . N augprint N . (Limitations) (Append-only) set . set : ) ) . 192.0.2.3 /etc/hosts . . "augtool" . (Repeated Values) augprint . augprint . . /etc/hosts : #------ 192.0.2.3 defaultdns #------ augprint : set /files/etc/hosts/#comment[.='--------'][1] '--------' set /files/etc/hosts/seq::*[ipaddr='192.0.2.3']/ipaddr '192.0.2.3' set /files/etc/hosts/seq::*[ipaddr='192.0.2.3']/canonical 'defaultdns' set /files/etc/hosts/#comment[.='--------'][2] '--------' "#comment" "[1]" "[2]" "[expr]" . . (OPTIONS) -v, --verbose -p, --pretty -r, -rN, --regexp, --regexp=N N N 8 -l, --lens=LENS LENS augprint -t targetfile, --target=targetfile FILE targetfile targetfile FILE targetfile targetfile '/' --target <<>> -s, --noseq "seq::*" "*" : set /files/etc/hosts/*[ipaddr='127.0.0.1']/ipaddr '127.0.0.1' : 127.0.0.1 . "--noseq" augeas 1.13.0 ( ) (EXAMPLES) /etc/hosts FILE : 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 192.0.2.3 dns-a 192.0.2.4 dns-b "augtool 'print /files/etc/hosts'" : /files/etc/hosts /files/etc/hosts/1 /files/etc/hosts/1/ipaddr = "127.0.0.1" /files/etc/hosts/1/canonical = "localhost" /files/etc/hosts/1/alias[1] = "localhost.localdomain" /files/etc/hosts/1/alias[2] = "localhost4" /files/etc/hosts/1/alias[3] = "localhost4.localdomain4" /files/etc/hosts/2 /files/etc/hosts/2/ipaddr = "192.0.2.3" /files/etc/hosts/2/canonical = "dns-a" /files/etc/hosts/3 /files/etc/hosts/3/ipaddr = "192.0.2.4" /files/etc/hosts/3/canonical = "dns-b" (Default output) "augprint /etc/hosts" set /files/etc/hosts/seq::*[ipaddr='127.0.0.1']/ipaddr '127.0.0.1' set /files/etc/hosts/seq::*[ipaddr='127.0.0.1']/canonical 'localhost' set /files/etc/hosts/seq::*[ipaddr='127.0.0.1']/alias[.='localhost.localdomain'] 'localhost.localdomain' set /files/etc/hosts/seq::*[ipaddr='127.0.0.1']/alias[.='localhost4'] 'localhost4' set /files/etc/hosts/seq::*[ipaddr='127.0.0.1']/alias[.='localhost4.localdomain4'] 'localhost4.localdomain4' set /files/etc/hosts/seq::*[ipaddr='192.0.2.3']/ipaddr '192.0.2.3' set /files/etc/hosts/seq::*[ipaddr='192.0.2.3']/canonical 'dns-a' set /files/etc/hosts/seq::*[ipaddr='192.0.2.4']/ipaddr '192.0.2.4' set /files/etc/hosts/seq::*[ipaddr='192.0.2.4']/canonical 'dns-b' (Verbose output) "augprint --verbose /etc/hosts" # /files/etc/hosts # /files/etc/hosts/1 # /files/etc/hosts/1/ipaddr '127.0.0.1' set /files/etc/hosts/seq::*[ipaddr='127.0.0.1']/ipaddr '127.0.0.1' # /files/etc/hosts/1/canonical 'localhost' set /files/etc/hosts/seq::*[ipaddr='127.0.0.1']/canonical 'localhost' # /files/etc/hosts/1/alias[1] 'localhost.localdomain' set /files/etc/hosts/seq::*[ipaddr='127.0.0.1']/alias[.='localhost.localdomain'] 'localhost.localdomain' ... (Rexexp output) "augprint --regexp=4 /etc/hosts" set /files/etc/hosts/seq::*[ipaddr=~regexp('127\\..*')]/ipaddr '127.0.0.1' set /files/etc/hosts/seq::*[ipaddr=~regexp('127\\..*')]/canonical 'localhost' set /files/etc/hosts/seq::*[ipaddr=~regexp('127\\..*')]/alias[.=~regexp('localhost\\..*')] 'localhost.localdomain' set /files/etc/hosts/seq::*[ipaddr=~regexp('127\\..*')]/alias[.=~regexp('localhost4')] 'localhost4' set /files/etc/hosts/seq::*[ipaddr=~regexp('127\\..*')]/alias[.=~regexp('localhost4\\..*')] 'localhost4.localdomain4' set /files/etc/hosts/seq::*[ipaddr=~regexp('192\\.0\\.2\\.3')]/ipaddr '192.0.2.3' set /files/etc/hosts/seq::*[ipaddr=~regexp('192\\.0\\.2\\.3')]/canonical 'dns-a' set /files/etc/hosts/seq::*[ipaddr=~regexp('192\\.0\\.2\\.4')]/ipaddr '192.0.2.4' set /files/etc/hosts/seq::*[ipaddr=~regexp('192\\.0\\.2\\.4')]/canonical 'dns-b' augprint . --lens (Using --lens) --lens lensname . --lens "transform" "load-file" augtool setm . "augprint --lens shellvars /etc/skel/.bashrc" setm /augeas/load/*[incl='/etc/skel/.bashrc' and label() != 'shellvars']/excl '/etc/skel/.bashrc' transform shellvars incl /etc/skel/.bashrc load-file /etc/skel/.bashrc set /files/etc/skel/.bashrc/#comment[.='.bashrc'] '.bashrc' set /files/etc/skel/.bashrc/#comment[.='Source global definitions'] 'Source global definitions' set /files/etc/skel/.bashrc/@if[.='[ -f /etc/bashrc ]'] '[ -f /etc/bashrc ]' set /files/etc/skel/.bashrc/@if[.='[ -f /etc/bashrc ]']/.source '/etc/bashrc' set /files/etc/skel/.bashrc/#comment[.='User specific environment'] 'User specific environment' ... "simplelines" "shellvars" . --target (Using --target) augtool . --target : ) /etc/hosts cp /etc/hosts ~ ) ~/hosts echo '192.0.2.7 defaultdns' >> ~/hosts ) "augprint" augprint --target /etc/hosts ~/hosts ) augtool Augeas set /files/etc/hosts/seq::*[ipaddr='192.0.2.7']/ipaddr '192.0.2.7' set /files/etc/hosts/seq::*[ipaddr='192.0.2.7']/canonical 'defaultdns' "augprint" --target (/etc/hosts) FILE (~/hosts). (ENVIRONMENT) AUGEAS_ROOT '/' . AUGEAS_LENS_LIB . /usr/share/augeas/lenses /usr/share/augeas/lenses/dist . (EXIT STATUS) . (FILES) /usr/share/augeas/lenses /usr/share/augeas/lenses/dist (AUTHOR) George Hansper (COPYRIGHT AND LICENSE) George Hansper . Augeas ( augprint) (LGPL) . . (SEE ALSO) augtool(1) Augeas: Augeas: Augeas 1.14.1 2023-07-14 AUGPRINT(1)