Korn Shell Programming by Example
Synopsis
A methodical, concept-building book that readers can use as
a programming reference, as well as a tutorial for learning
to program in Linux/UNIX
An essential reference for administrators on how to
program their system.
Contents
|
Introduction |
1 |
|
Assumptions About the Reader |
1 |
|
What This Book Will Give You |
2 |
|
What This Book Will Not Give You |
2 |
|
Conventions |
2 |
| 1 |
The Environment |
5 |
|
What Is a Shell? |
6 |
|
What Is a Shell Script? |
7 |
|
#!/bin/ksh Explained |
7 |
|
Coming Full Circle--Back to umask |
18 |
|
#--Comments Explained |
19 |
|
The .profile Script |
20 |
|
Aliases |
22 |
|
Ksh Environment Options |
23 |
|
Variables |
24 |
|
Environment File |
30 |
|
History File and Repetition |
33 |
| 2 |
Process Control |
39 |
|
How to Run a Script |
40 |
|
Jobs and Processes |
42 |
|
Signals |
52 |
|
nohup Explained |
62 |
|
Scheduling Jobs |
64 |
| 3 |
Variables |
73 |
|
Case Sensitivity |
74 |
|
Valid Characters |
74 |
|
Scalar |
75 |
|
Array |
81 |
|
Read-Only |
84 |
|
Unsetting |
84 |
| 4 |
Regular Expressions |
87 |
|
Regular Expressions Versus Wildcards |
88 |
|
Character Classes |
90 |
|
Pattern Matching |
92 |
|
Metacharacters |
96 |
|
Back References |
97 |
| 5 |
Quoting |
101 |
|
Escape Character |
102 |
|
Aggregate Quoting Options |
104 |
|
Line Continuation |
106 |
|
Command Substitution--Two Ways |
107 |
|
Parameter Expansion |
108 |
|
Arithmetic Expansion |
113 |
| 6 |
Flow Control |
117 |
|
If Test |
118 |
|
Compound If Tests |
126 |
|
Case Conditionals |
128 |
|
Looping Constructs |
129 |
|
Loop-Related Commands |
137 |
|
Backup Loop Example |
137 |
| 7 |
Data Manipulation |
143 |
|
Functions |
144 |
|
Function Programming Details |
150 |
|
Math |
160 |
|
Filters |
165 |
|
Testing Files |
169 |
| 8 |
Information Passing |
179 |
|
Command-Line Arguments |
180 |
|
User Input |
185 |
|
Redirection |
194 |
|
Coprocess |
197 |
| 9 |
File and Directory Manipulation |
205 |
|
Paths |
206 |
|
Descriptors |
209 |
|
Special Files |
211 |
|
Links |
212 |
|
Directories |
216 |
|
Hidden Files |
218 |
|
Attributes |
219 |
|
Permissions |
222 |
|
Acceptable Filenames |
223 |
|
Accessing Files |
224 |
|
Filtering |
229 |
|
Using Temporary Files |
239 |
| 10 |
Output Control |
243 |
|
Echoing Output |
244 |
|
Printf |
248 |
|
Output Redirection |
252 |
|
Multiple Output Redirection |
255 |
|
Pipes Versus Redirection |
255 |
|
Stderr Redirection |
256 |
|
Here Documents |
257 |
| 11 |
Diagnostics |
261 |
|
Syntax Checking |
262 |
|
Command Interpretation Sequence |
264 |
|
Verbose Mode |
265 |
|
Execution Trace |
267 |
|
Debugging Hooks |
270 |
| 12 |
Traps |
275 |
|
Defining and Using Traps |
276 |
|
Documentation Support |
281 |
|
Self-Help Scripts |
282 |
|
Bulletproofing |
282 |
| 13 |
Pulling It All Together |
289 |
|
The sys_check Script |
290 |
|
First sys_check Run |
292 |
|
Second sys_check Run |
305 |
|
Numbered Version of sys_check Script |
308 |
| A |
Useful Commands |
321 |
|
alias |
322 |
|
autoload |
324 |
|
bg |
325 |
|
break |
326 |
|
builtin |
327 |
|
case |
328 |
|
cat |
329 |
|
cd |
330 |
|
chmod |
331 |
|
command |
332 |
|
continue |
333 |
|
cp |
335 |
|
cut |
336 |
|
date |
337 |
|
disown |
338 |
|
echo |
339 |
|
ed |
339 |
|
eval |
340 |
|
exec |
341 |
|
exit |
342 |
|
export |
343 |
|
false |
345 |
|
fc |
346 |
|
fg |
347 |
|
find |
348 |
|
float |
350 |
|
for |
350 |
|
function |
351 |
|
getconf |
352 |
|
getopts |
353 |
|
grep |
353 |
|
hash |
354 |
|
hist |
355 |
|
history |
356 |
|
if |
357 |
|
integer |
358 |
|
jobs |
359 |
|
kill |
359 |
|
[ |
360 |
|
let |
361 |
|
ln |
362 |
|
mv |
363 |
|
newgrp |
363 |
|
nohup |
364 |
|
: |
364 |
|
paste |
365 |
|
print |
366 |
|
printf |
366 |
|
pwd |
367 |
|
r |
367 |
|
read |
369 |
|
readonly |
369 |
|
return |
370 |
|
rm |
371 |
|
rmdir |
372 |
|
script |
372 |
|
select |
375 |
|
set |
375 |
|
shift |
376 |
|
sleep |
377 |
|
sort |
378 |
|
stop |
379 |
|
tail |
380 |
|
tee |
381 |
|
test |
382 |
|
time |
382 |
|
touch |
383 |
|
tr |
384 |
|
trap |
384 |
|
true |
385 |
|
tty |
386 |
|
type |
386 |
|
typeset |
387 |
|
ulimit |
389 |
|
umask |
390 |
|
unalias |
390 |
|
uniq |
391 |
|
unset |
393 |
|
until |
394 |
|
wait |
394 |
|
wc |
395 |
|
whence |
396 |
|
while |
396 |
|
who |
397 |
| B |
vi Tutorial |
401 |
|
Where vi Came From |
402 |
|
Starting an Edit Session |
403 |
|
Modes of Operation |
404 |
|
Last-Line Mode |
406 |
|
Exiting from the Editor |
406 |
|
Moving the Cursor |
407 |
|
Deleting |
408 |
|
Cutting and Pasting |
409 |
|
Using Multiple Buffers |
409 |
|
Searching and Replacing |
410 |
|
Changing vi Environment Settings |
412 |
|
Edit Session Recovery |
415 |
|
Miscellaneous Commands |
416 |
|
Index |
415 |
Commander ce livre au
prix de
39,89
€
37,9
€
Classé sous : Command, Files, Script, Environment, Redirection
Livres en rapport
|
Derniers Blogs
GESTION D'EXCEPTION AVEC LES TASKSGESTION D'EXCEPTION AVEC LES TASKS par richardc
Nous avons vu dans un précédent article comment utiliser Task pour effectuer des opérations dans un autre thread.
Malheureusement, comme tout le monde n'est pas parfait, il se peut que cette exécution se passe mal et qu'une exception se produise.
La...
Cliquez pour lire la suite de l'article par richardc DéMARRONS AVEC LES TASKSDéMARRONS AVEC LES TASKS par richardc
Que vous le vouliez ou non, le développement multi-tâche est maintenant une obligation pour toute nouvelle application. Il est donc vital d'en comprendre les mécanismes et de s'y mettre le plus tôt possible.
En attendant le .NET Framework 4.5 avec le...
Cliquez pour lire la suite de l'article par richardc SLIDE & DéMO TECHDAYS 2012 - FAST & FURIOUS XAML APPSSLIDE & DéMO TECHDAYS 2012 - FAST & FURIOUS XAML APPS par Vko
Retrouvez les slides et les démo de ma session Fast & Furious XAML Apps. A ceux qui se posent la question : "est-ce que le code de la DataGrid est disponible?", je vous répondrais "pas encore". Je vais mettre en place un projet codeplex pour part...
Cliquez pour lire la suite de l'article par Vko XNA IS DEAD!XNA IS DEAD! par richardc
Depuis la semaine dernière (et grâce aux TechDays 2012), je me penche activement sur la nouvelle version de Windows, aka Windows 8. Vous me direz, il était temps puisque la première preview date de Septembre dernier.
OK. Remarquez, on n'en est qu'aux...
Cliquez pour lire la suite de l'article par richardc TECHDAYS PARIS 2012 : WINDOWS SERVER "8" QUOI DE 9 !TECHDAYS PARIS 2012 : WINDOWS SERVER "8" QUOI DE 9 ! par ROMELARD Fabrice
Speakers: Fabrice Meillon et Stanislas Quastana Cette session est basée entièrement sur celle donnée lors de la BUILD cet hiver. Il n'y a pas d'ajout d'information en rapport avec cet évènement passé. Windows 8 Server sera intégralem...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice
Logiciels
DocTranslate (V3.1.0.0)DOCTRANSLATE (V3.1.0.0)DocTranslate est un traducteur de document Microsoft Word, PowerPoint et Excel. Il permet d'autom... Cliquez pour télécharger DocTranslate Tribler (2012)TRIBLER (2012)Tribler est un client pair à pair (P2P/Peer-to-Peer) open source avec la capacité de regarder des... Cliquez pour télécharger Tribler OneSwarm (2012)ONESWARM (2012)Le peer-to-peer qui protège votre vie privée, c'est OneSwarm.
Ce logiciel de peer-to-peer crypté... Cliquez pour télécharger OneSwarm PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V8.4)PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V8.4)PONAMEDIA TV DEVIENS HELLLOOO FLASH
LA TV SUR VOTRE ORDINATEUR.
Toute une plateforme Multi... Cliquez pour télécharger PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO Academy System (17.2.1.0)ACADEMY SYSTEM (17.2.1.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System
|