zeus 4 years ago
parent
commit
e80bc7f427
  1. 101
      labs/ls/heredocs_ls.adoc.html
  2. 1795
      labs/ls/heredocs_ls.adoc.pdf

101
labs/ls/heredocs_ls.adoc.html

@ -455,6 +455,8 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<li><a href="#_expansion">1.2. expansion</a></li> <li><a href="#_expansion">1.2. expansion</a></li>
</ul> </ul>
</li> </li>
<li><a href="#_bash_positional_parameters">2. Bash Positional Parameters</a></li>
<li><a href="#_extras">3. extras</a></li>
</ul> </ul>
</div> </div>
</div> </div>
@ -519,7 +521,20 @@ for i in "${!array[@]}"; do
done done
echo "" echo ""
echo ""</code></pre> echo ""
cat &lt;&lt; FOE &gt; testfile.sh
declare -A array=(
[1,0]="first name"
[1,1]="second name"
[2,0]="third name"
[3,0]="foo bar"
[test 1]="test bar"
)
EOF
)</code></pre>
</div> </div>
</div> </div>
</div> </div>
@ -533,12 +548,94 @@ echo "${!win}" # we print the variable linked by $win's content</cod
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
<div class="sect1">
<h2 id="_bash_positional_parameters">2. Bash Positional Parameters</h2>
<div class="sectionbody">
<div class="ulist">
<ul>
<li>
<p>vim testvar.sh</p>
</li>
<li>
<p>cut-paste</p>
</li>
<li>
<p>chmod +x ./testvar.sh</p>
</li>
<li>
<p>./testvar.sh a1 a2 a3 a4 a5 a6 a7 a8 a9 10 11 12 13</p>
</li>
</ul>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bash" data-lang="bash">echo $#
echo $@
echo $?
cat &lt;&lt;'EOF'
$# = number of arguments.
$@ = what parameters were passed.
$* = what parameters were passed.
$? = was last command successful. Answer is 0 which means 'yes'
EOF
cat &lt;&lt; FOE &gt; testfile.sh
#!/bin/bash
RUSER=$1
ID=$2
SERVICE=$3
SERVICE_STACK=$4
VNCport=$5
RREPLICAS=$6
RREGION=$7
TTYport=$8
PASSWORDrw=$9
PASSWORDview=${10}
GIT_TUTOR=${11}
REBOOT=${12}
USERscope=${13}
FOE
chmod +x ./testfile.sh
#./testfile.sh
#
cat &lt;&lt; 'FOE' &gt; testfile1.sh
#!/bin/bash
RUSER=$1
ID=$2
SERVICE=$3
SERVICE_STACK=$4
VNCport=$5
RREPLICAS=$6
RREGION=$7
TTYport=$8
PASSWORDrw=$9
PASSWORDview=${10}
GIT_TUTOR=${11}
REBOOT=${12}
USERscope=${13}
FOE
chmod +x ./testfile1.sh</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_extras">3. extras</h2>
<div class="sectionbody">
</div> </div>
</div> </div>
</div> </div>
<div id="footer"> <div id="footer">
<div id="footer-text"> <div id="footer-text">
Last updated 2020-11-30 22:45:51 UTC Last updated 2020-11-30 23:08:18 UTC
</div> </div>
</div> </div>
</body> </body>

1795
labs/ls/heredocs_ls.adoc.pdf

File diff suppressed because it is too large
Loading…
Cancel
Save