Skip to content

Instantly share code, notes, and snippets.

@domcleal domcleal/.gitignore
Last active Apr 20, 2017

Embed
What would you like to do?
Copy part of an Augeas XML tree into another file
output.xml
#!/bin/bash
orig=$PWD/original.xml
new=$PWD/output.xml
rm -f $new
augtool -s -e -t "Xml incl $orig" -t "Xml incl $new" <<EOF
cp /files$orig/xml/Child[2]/ChildOfChild/Child /files$new/VirtualHost/Child
EOF
cat $new
<xml>
<Child></Child>
<Child> <ChildOfChild> <Child>
<Directory foo="bar" />
<Foo>bar</Foo>
</Child> </ChildOfChild> </Child>
</xml>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.