From 2d6231ad4d33d6b70c39c2b4b7ecc005599c0d80 Mon Sep 17 00:00:00 2001 From: Abreto FU Date: Thu, 6 Feb 2020 20:45:58 +0000 Subject: [PATCH] Remove a useless '\' and enhance a script in an example in the section 'Add entries ... (--add-host)' Signed-off-by: Abreto FU (cherry picked from commit 07436dfe78e293507adfbf82ffea1ad6e6605c34) Signed-off-by: Sebastiaan van Stijn --- docs/reference/commandline/run.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/commandline/run.md b/docs/reference/commandline/run.md index db24803336..cc64c540d7 100644 --- a/docs/reference/commandline/run.md +++ b/docs/reference/commandline/run.md @@ -689,7 +689,7 @@ using IPv4 or IPv6 networking in your containers. Use the following flags for IPv4 address retrieval for a network device named `eth0`: ```bash -$ HOSTIP=`ip -4 addr show scope global dev eth0 | grep inet | awk '{print \$2}' | cut -d / -f 1` +$ HOSTIP=`ip -4 addr show scope global dev eth0 | grep inet | awk '{print $2}' | cut -d / -f 1 | sed -n 1p` $ docker run --add-host=docker:${HOSTIP} --rm -it debian ```