From 79fc3ca1232099fd21e5bdef14c1b6fe1d2dbc1c Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 30 Apr 2014 14:24:08 -0700 Subject: CodingGuidelines: give an example for case/esac statement Signed-off-by: Junio C Hamano --- Documentation/CodingGuidelines | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines index c405b0b9d..169b4358c 100644 --- a/Documentation/CodingGuidelines +++ b/Documentation/CodingGuidelines @@ -42,7 +42,17 @@ For shell scripts specifically (not exhaustive): - We use tabs for indentation. - - Case arms are indented at the same depth as case and esac lines. + - Case arms are indented at the same depth as case and esac lines, + like this: + + case "$variable" in + pattern1) + do this + ;; + pattern2) + do that + ;; + esac - Redirection operators should be written with space before, but no space after them. In other words, write 'echo test >"$file"' -- cgit v1.2.1