Section A.3. Modified Backus-Naur Notation


[Page 597 (continued)]

A.3. Modified Backus-Naur Notation

The syntax of the GNU utilities and Linux system calls in this book are presented in a modified version of a language known as Backus-Naur Form, or BNF for short. In a BNF description, the sequences in Figure A-5 have a special meaning.


[Page 598]

Figure A-5. BNF notations used in this book.

Sequence

Meaning

[ strings ]

Strings may appear zero or one time.

{ strings }*

Strings may appear zero or more times.

{ strings }+

Strings may appear one or more times.

string1|string2

string1 or string2 may appear.

-optionlist

Zero or more options may follow a dash.


The last sequence is the Linux/GNU-oriented modification, which allows me to avoid placing large numbers of brackets around command-line options. To indicate a [, {, |, or - without its special meaning, I precede it with a \ character.

Some variations of commands depend on which option you choose. I indicate this by supplying a separate syntax description for each variation. For example, take a look at the syntax description of the at utility (Figure A-6).

Figure A-6. Example description of the at command

Utility: at -csm time [ date [, year ]][ +increment][ script]

at -r { jobId}+

at -l { jobId}*


The first version of the at utility is selected by any combination of the command-line options -c, -s, and -m. These must then be followed by a time and an optional date specifier. The optional date specifier may be followed by an optional year specifier. Additionally, an increment may be specified and/or a script name.

The second version of at is selected by a -r option, and may be followed by one or more job ID numbers.

The third version of at is selected by the -l option, and may be followed by zero or more job ID numbers.




Linux for Programmers and Users
Linux for Programmers and Users
ISBN: 0131857487
EAN: 2147483647
Year: 2007
Pages: 339

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net