From be87f493aeec235af69973ba43bf501f0dcaff59 Mon Sep 17 00:00:00 2001 From: Philip Molloy Date: Mon, 30 Apr 2018 17:18:07 -0400 Subject: [PATCH] Wrap with multiline shell conditionals --- shell.xml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/shell.xml b/shell.xml index 79f39f9..0a0069a 100644 --- a/shell.xml +++ b/shell.xml @@ -360,9 +360,21 @@ Revision 1.26 Put ; do and ; then on the same line as the - while, for or if. + while, for or if, unless the line + exceeds the maximum line length. +

+ Example: + + if [[ -d "${LONG_PATH_TO_DIRECTORY}" && \ + -f "${LONG_PATH_TO_FILE}" && \ + ! check_something ]] + then + delete_all_oracle_databases + fi + +

Loops in shell are a bit different, but we follow the same principles as with braces when declaring functions. That is: ; then