summary refs log tree commit diff
path: root/man/nmcli-examples.xml
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2017-05-11 14:55:55 +0200
committerMichael Biebl <biebl@debian.org>2017-05-11 14:55:55 +0200
commitc333f062ddcba9b35330647bf6cbd0a07f2d786e (patch)
tree257c3a0c74c09f4ad2328eab5b932806405f0c1c /man/nmcli-examples.xml
parenta222e56e103f949b148a6942e385ccca2c26d9f3 (diff)
New upstream version 1.8.0 upstream/1.8.0
Diffstat (limited to 'man/nmcli-examples.xml')
-rw-r--r--man/nmcli-examples.xml19
1 files changed, 19 insertions, 0 deletions
diff --git a/man/nmcli-examples.xml b/man/nmcli-examples.xml
index 864e6504..0b15f112 100644
--- a/man/nmcli-examples.xml
+++ b/man/nmcli-examples.xml
@@ -254,6 +254,25 @@ B,DISPATCH</screen>
       </para>
     </example>
 
+    <example><title>Convenient field values retrieval for scripting</title>
+<screen><prompt>$ </prompt><userinput>nmcli -g ip4.address connection show my-con-eth0</userinput>
+192.168.1.12/24</screen>
+<screen><prompt>$ </prompt><userinput>nmcli -g ip4.address,ip4.dns connection show my-con-eth0</userinput>
+192.168.1.12/24
+192.168.1.1</screen>
+<screen><prompt>$ </prompt><userinput>nmcli -g ip4 connection show my-con-eth0</userinput>
+IP4:192.168.1.12/24:192.168.1.1::192.168.1.1::</screen>
+      <para>
+        This example shows retrieval of ip4 connection field values via the --get-values
+        option. Multiple comma separated fields can be provided: they will be printed one
+        per line. If a whole section is provided instead of a single field, the name of the
+        section will be printed followed by all the related field values on the same line.
+        See also --terse, --mode, --fields and --escape options in <link linkend='nmcli'><citerefentry><refentrytitle>nmcli</refentrytitle><manvolnum>1</manvolnum></citerefentry></link>
+        manual page for more customized output.
+      </para>
+    </example>
+
+
     <example><title>Escaping colon characters in tabular mode</title>
 <screen><prompt>$ </prompt><userinput>nmcli -t -f general -e yes -m tab dev show eth0</userinput>
 GENERAL:eth0:ethernet:Intel Corporation:82567LM Gigabit Network Connection: