27.08.2015 Views

Advanced Bash−Scripting Guide

Advanced Bash-Scripting Guide - Nicku.org

Advanced Bash-Scripting Guide - Nicku.org

SHOW MORE
SHOW LESS
  • No tags were found...

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

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

Appendix J. Copyright<br />

The "<strong>Advanced</strong> <strong>Bash−Scripting</strong> <strong>Guide</strong>" is copyright, (c) 2000, by Mendel Cooper. This document may only<br />

be distributed subject to the terms and conditions set forth in the Open Publication License (version 1.0 or<br />

later), http://www.opencontent.org/openpub/. The following license options also apply.<br />

A. Distribution of substantively modified versions of this document<br />

is prohibited without the explicit permission of the copyright holder.<br />

B. Distribution of the work or derivative of the work in any standard<br />

(paper) book form is prohibited unless prior permission is obtained from<br />

the copyright holder.<br />

Essentially, you may freely distribute this book in unaltered electronic form. You must obtain the author's<br />

permission to distribute a substantially modified version or derivative work. The purpose of this restriction is<br />

to preserve the artistic integrity of this document and to prevent "forking".<br />

These are very liberal terms, and they should not hinder any legitimate distribution or use of this book. The<br />

author especially encourages the use of this book for instructional purposes.<br />

The commercial print rights to this book are available. Please contact the author if interested.<br />

The author produced this book in a manner consistent with the spirit of the LDP Manifesto.<br />

−−−<br />

Hyun Jin Cha has done a Korean translation of version 1.0.11 of this book. Spanish, Portuguese, French,<br />

German, and Chinese translations are underway. If you wish to translate this document into another language,<br />

please feel free to do so, subject to the terms stated above. The author wishes to be notified of such efforts.<br />

Notes<br />

[1] These are referred to as builtins, features internal to the shell.<br />

[2] Many of the features of ksh88, and even a few from the updated ksh93 have been merged into Bash.<br />

[3] By convention, user−written shell scripts that are Bourne shell compliant generally take a name with a<br />

.sh extension. System scripts, such as those found in /etc/rc.d, do not follow this guideline.<br />

[4] Some flavors of UNIX (those based on 4.2BSD) take a four−byte magic number, requiring a blank after<br />

the !, #! /bin/sh.<br />

[5] The #! line in a shell script will be the first thing the command interpreter (sh or bash) sees. Since this<br />

line begins with a #, it will be correctly interpreted as a comment when the command interpreter finally<br />

executes the script. The line has already served its purpose − calling the command interpreter.<br />

If, in fact, the script includes an extra #! line, then bash will interpret it as a comment.<br />

#!/bin/bash<br />

echo "Part 1 of script."<br />

a=1<br />

#!/bin/bash<br />

# This does *not* launch a new script.<br />

Appendix J. Copyright 440

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

Saved successfully!

Ooh no, something went wrong!