Posted in Programming

Download Advanced Bash−Scripting Guide by Mendel Cooper PDF

By Mendel Cooper

Данное руководство не предполагает наличие у читателя познаний в области программирования на языке сценариев, однако, быстро восполняет этот недостаток . . . постепенно, шаг за шагом раскрывая мудрость и красоту Unix(tm). Это руководство может рассматриваться как учебник, предназначенный для самостоятельного изучения или как справочник по программированию на shell. Руководство снабжено серией хорошо прокомментированных примеров, поскольку лучший путь к изучению языка сценариев -- это написание сценариев.

Кроме того, эта книга может служить в качестве учебного пособия по основам програмирования вообще.

Show description

Read or Download Advanced Bash−Scripting Guide PDF

Best programming books

Processing: A Programming Handbook for Visual Designers and Artists

It's been greater than two decades considering computing device publishing reinvented layout, and it's transparent that there's a growing to be desire for designers and artists to benefit programming abilities to fill the widening hole among their rules and the potential in their bought software program. This booklet is an creation to the ideas of machine programming in the context of the visible arts.

Common Lisp: A Gentle Introduction to Symbolic Computation

A hugely obtainable creation to LISP, this can be for green programmers and programmers new to LISP. A LISP "toolkit" in each one bankruptcy explains how you can use universal LISP programming and debugging instruments reminiscent of DESCRIBE, check up on, hint and STEP.

Extra info for Advanced Bash−Scripting Guide

Sample text

Chapter 4. Introduction to Variables and Parameters 33 Chapter 5. Quoting Quoting means just that, bracketing a string in quotes. This has the effect of protecting special characters in the string from reinterpretation or expansion by the shell or shell script. sh bash$ ls −l '[Vv]*' ls: [Vv]*: No such file or directory In everyday speech or writing, when we "quote" a phrase, we set it apart and give it special meaning. In a Bash script, when we quote a string, we set it apart and protect its literal meaning.

Therefore, in a Bash script, test does not call the external /usr/bin/test binary, which is part of the sh−utils package. Likewise, [ does not call /usr/bin/[, which is linked to /usr/bin/test. bash$ type test test is a shell builtin bash$ type '[' [ is a shell builtin bash$ type '[[' [[ is a shell keyword bash$ type ']]' ]] is a shell keyword bash$ type ']' bash: type: ]: not found Example 7−2. " fi echo if /usr/bin/test −z "$1" # Same result as "test" builtin". " fi echo if [ −z "$1" ] # Functionally identical to above code blocks.

Introduction to Variables and Parameters 31 Advanced Bash−Scripting Guide args=$# # Number of args passed. $#} doesn't work. Some scripts can perform different operations, depending on which name they are invoked with. For this to work, the script needs to check $0, the name it was invoked by. There must also exist symbolic links to all the alternate names of the script. See Example 12−2. If a script expects a command line parameter but is invoked without one, this may cause a null variable assignment, generally an undesirable result.

Download PDF sample

Rated 4.04 of 5 – based on 14 votes