From c3b684f9b63541b298c623cf0a77b0864153c8fb Mon Sep 17 00:00:00 2001 From: xuhuilong Date: Sat, 28 Oct 2017 01:22:15 +0800 Subject: [PATCH] wrong bash statements. (#6071) here is my test result: [root@localhost ~]# sh -c 'for i in {1..100}; do sleep 1; if dig www.baidu.com;then exit 0; fi; exit 1' sh: -c: line 1: syntax error: unexpected end of file [root@localhost ~]# sh -c 'for i in {1..100}; do sleep 1; if dig www.baidu.com;then exit 0; fi;done; exit 1' ; <<>> DiG 9.9.4-RedHat-9.9.4-51.el7 <<>> www.baidu.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 27927 ;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 512 ;; QUESTION SECTION: ;www.baidu.com. IN A ;; ANSWER SECTION: www.baidu.com. 1125 IN CNAME www.a.shifen.com. www.a.shifen.com. 106 IN A 180.97.33.107 www.a.shifen.com. 106 IN A 180.97.33.108 ;; Query time: 16 msec ;; SERVER: 192.168.0.1#53(192.168.0.1) ;; WHEN: Fri Oct 27 02:42:38 EDT 2017 ;; MSG SIZE rcvd: 101 [root@localhost ~]# echo $? 0 [root@localhost ~]# --- docs/concepts/workloads/pods/init-containers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/concepts/workloads/pods/init-containers.md b/docs/concepts/workloads/pods/init-containers.md index 9d014b8019..b1b7120d46 100644 --- a/docs/concepts/workloads/pods/init-containers.md +++ b/docs/concepts/workloads/pods/init-containers.md @@ -75,7 +75,7 @@ Here are some ideas for how to use Init Containers: * Wait for a service to be created with a shell command like: - for i in {1..100}; do sleep 1; if dig myservice; then exit 0; fi; exit 1 + for i in {1..100}; do sleep 1; if dig myservice; then exit 0; fi; done; exit 1 * Register this Pod with a remote server from the downward API with a command like: