Skip to content

Commit

Permalink
exploiring
Browse files Browse the repository at this point in the history
  • Loading branch information
raphink committed Jun 12, 2012
1 parent 76ae71d commit 80b4a9d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions en/chapters/exploring_augtool.tex
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@ \chapter{Exploring augtool}
and yet others, look you, hereabout;\\ and yet others, look you, hereabout;\\
and each flock hath his several fold builded.}{Idyll 25.7}{Theocritus} and each flock hath his several fold builded.}{Idyll 25.7}{Theocritus}


Augeas is primarily a C library with bindings but it also provides a command-line tool called \verb!augtool!, which we will be using in the following examples. In chapter~\ref{chap:api}, we will see how to use the API and bindings directly. Augeas is primarily a C library with bindings but it also provides a command-line tool called \verb!augtool!, which we will be using in the following examples. In chapter~\ref{chap:api}, we will see how to use the C~API and bindings directly.




\section{Parsing your System Configuration Files} \section{Parsing your System Configuration Files}


The first thing we might want to do is to see how Augeas sees your system configuration files. Fire up \verb!augtool!: The first thing you might want to do is to explore how Augeas sees your system configuration files. Fire up \verb!augtool!:


\consolecode/$ augtool/ \consolecode/$ augtool/
This will give you an interactive shell which passes commands to Augeas. This will give you an interactive shell which passes commands to Augeas.
To see which commands your version of \texttt{augtool} supports, simply type \texttt{help}: To see which commands your version of \texttt{augtool} supports, simply type \texttt{help}:
\nopagebreak
\begin{augtoolsh}[] \begin{augtoolsh}[]
augtool> help augtool> help
Commands: Commands:
Expand All @@ -44,10 +45,10 @@ \section{Parsing your System Configuration Files}
print - print a subtree print - print a subtree
dump-xml - print a subtree as XML dump-xml - print a subtree as XML
rm - delete nodes and subtrees rm - delete nodes and subtrees
save - save all pending changes
set - set the value of a node
\end{augtoolsh} \end{augtoolsh}
\begin{augtoolsh}[] \begin{augtoolsh}[]
save - save all pending changes
set - set the value of a node
setm - set the value of multiple nodes setm - set the value of multiple nodes
clearm - clear the value of multiple nodes clearm - clear the value of multiple nodes
span - print position in input file corresponding to tree span - print position in input file corresponding to tree
Expand Down Expand Up @@ -125,7 +126,7 @@ \section{Parsing your System Configuration Files}
/files/etc/fstab/1/opt[3] = nosuid /files/etc/fstab/1/opt[3] = nosuid
\end{augtoolsh} \end{augtoolsh}
Now, we might want to get the value of the single node matching an expression, and make sure that this node is unique. For example, if we want the value of the first \verb!opt! node of this first line, we could use the \verb!get! command: Now, you might want to get the value of the single node matching an expression, and make sure that this node is unique. For example, if we want the value of the first \verb!opt! node of this first line, we could use the \verb!get! command:
\begin{augtoolsh}[] \begin{augtoolsh}[]
augtool> get /files/etc/fstab/1/opt[1] augtool> get /files/etc/fstab/1/opt[1]
Expand Down

0 comments on commit 80b4a9d

Please sign in to comment.