Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion shell.xml
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,21 @@ Revision 1.26
<STYLEPOINT title="Loops">
<SUMMARY>
Put <code>; do</code> and <code>; then</code> on the same line as the
<code>while</code>, <code>for</code> or <code>if</code>.
<code>while</code>, <code>for</code> or <code>if</code>, unless the line
exceeds the maximum line length.
</SUMMARY>
<BODY>
<p>
Example:
<CODE_SNIPPET>
if [[ -d "${LONG_PATH_TO_DIRECTORY}" &amp;&amp; \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the continuation slashes are superfluous within this conditional

-f "${LONG_PATH_TO_FILE}" &amp;&amp; \
! check_something ]]
then
delete_all_oracle_databases
fi
</CODE_SNIPPET>
</p>
<p>
Loops in shell are a bit different, but we follow the same principles
as with braces when declaring functions. That is: <code>; then</code>
Expand Down