24.07.2018 Views

Bash-Beginners-Guide

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

if [ $i -eq<br />

5 ]<br />

ArrowUp+Enter or !! r !!<br />

!str r str !str<br />

!cmd:s/x/y/ r x=y cmd !cmd:s/x/y/<br />

if [ $i -eq 5 ] if ((i==5)) if ($i==5)<br />

Redo previous<br />

command<br />

Redo last<br />

command that<br />

starts with "str"<br />

Replace "x" with<br />

"y" in most<br />

recent command<br />

starting with<br />

"cmd", then<br />

execute.<br />

Sample<br />

condition test<br />

fi fi fi endif End if statement<br />

ulimit ulimit ulimit limit<br />

pwd pwd pwd dirs<br />

read read read $<<br />

Set resource<br />

limits<br />

Print working<br />

directory<br />

Read from<br />

terminal<br />

trap 2 trap 2 trap 2 onintr Ignore interrupts<br />

unalias unalias unalias Remove aliases<br />

until until until Begin until loop<br />

while/do while/do while/do while Begin while loop<br />

The Bourne Again SHell has many more features not listed here. This table is just to give you an idea of how<br />

this shell incorporates all useful ideas from other shells: there are no blanks in the column for bash. More<br />

information on features found only in <strong>Bash</strong> can be retrieved from the <strong>Bash</strong> info pages, in the "<strong>Bash</strong> Features"<br />

section.<br />

More information:<br />

<strong>Bash</strong> <strong>Guide</strong> for <strong>Beginners</strong><br />

You should at least read one manual, being the manual of your shell. The preferred choice would be info<br />

bash, bash being the GNU shell and easiest for beginners. Print it out and take it home, study it whenever you<br />

have 5 minutes.<br />

Appendix A. Shell Features 145

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!