Hash :
49a1467b
Author :
Date :
2014-12-22T09:14:46
<h1>Bash</h1>
<p>To use this language, use the class "language-bash".</p>
<h2>Shebang</h2>
<pre><code>#!/bin/bash</code></pre>
<h2>Comments</h2>
<pre><code># This is a comment</code></pre>
<h2>Strings</h2>
<pre><code>STRING="Hello World"
'Single and
multi-line strings are supported.'
"Single and
multi-line strings are supported."</code></pre>
<h2>Variables</h2>
<pre><code>echo $STRING
args=("$@")
echo ${args[0]} ${args[1]} ${args[2]}</code></pre>
<h2>Keywords</h2>
<pre><code>for (( i=0;i<$ELEMENTS;i++)); do
echo ${ARRAY[${i}]}
done
while read LINE; do
ARRAY[$count]=$LINE
((count++))
done
if [ -d $directory ]; then
echo "Directory exists"
else
echo "Directory does not exists"
fi
</code></pre>