Skip to content

Wrap with multiline shell conditionals #358

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: gh-pages
Choose a base branch
from
Open
Changes from all commits
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;
-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