Read without ads and support Scribd by becoming a Scribd Premium Reader.
 
Linux, Shell Programing and Perl
byWilli-Hans Steeb, Gert Cronje and Yorick HardyInternational School for Scientific Computing
 
Contents
1 Linux Basics 1
1.1 Some Basic Commands . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Working with Files and Directories . . . . . . . . . . . . . . . . . . . 91.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91.2.2 The Home Directory and Path Names . . . . . . . . . . . . . 101.2.3 Important Directories in the Linux File System . . . . . . . . 121.2.4 Basic Files and Directories Commands . . . . . . . . . . . . . 131.2.5 File Name Substitution . . . . . . . . . . . . . . . . . . . . . . 301.3 Standard Input/Output, and I/O Redirection . . . . . . . . . . . . . 341.4 Additional Commands . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2 Advanced Linux 63
2.1 The Unix File System . . . . . . . . . . . . . . . . . . . . . . . . . . 632.2 Mounting and Unmounting . . . . . . . . . . . . . . . . . . . . . . . . 662.3 MTools Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 712.4 Swap Space and the Loopback Device . . . . . . . . . . . . . . . . . . 722.5 Network File-System . . . . . . . . . . . . . . . . . . . . . . . . . . . 732.6 Linuxconf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 742.7 Compressed Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 752.8 The vi and emacs Editors . . . . . . . . . . . . . . . . . . . . . . . . 782.8.1 vi Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 782.8.2 emacs Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . 862.9 Programming Languages . . . . . . . . . . . . . . . . . . . . . . . . . 892.9.1 C and C++ Compiler . . . . . . . . . . . . . . . . . . . . . . 892.9.2 Perl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 912.9.3 Lisp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 922.9.4 Java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
3 Linux and Networking 95
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 953.2 Basic Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 963.3 email . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1063.4 ftp Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1123.5 Telnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1153.6 Remote Shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117i
 
3.7 Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1183.8 INETD and Socket Programming . . . . . . . . . . . . . . . . . . . . 119
4 Shell Programming 123
4.1 What is a shell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1234.2 The Shell as a Programming Language . . . . . . . . . . . . . . . . . 1274.2.1 Creating a Script . . . . . . . . . . . . . . . . . . . . . . . . . 1284.2.2 Making a Script executable . . . . . . . . . . . . . . . . . . . 1294.3 Shell Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1304.3.1 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1304.3.2 Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1344.3.3 Control Structures . . . . . . . . . . . . . . . . . . . . . . . . 1374.3.4 Logical AND and Logical OR . . . . . . . . . . . . . . . . . . 1454.3.5 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1494.4 Shell Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1544.4.1 Builtin Commands . . . . . . . . . . . . . . . . . . . . . . . . 1544.4.2 Command Execution . . . . . . . . . . . . . . . . . . . . . . . 1634.5 Advanced examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
5 Perl 173
5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1735.2 My First Perl Program . . . . . . . . . . . . . . . . . . . . . . . . . . 1745.3 Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1755.4 Arithmetic Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . 1775.5 Standard Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1785.6 Basic String Operations . . . . . . . . . . . . . . . . . . . . . . . . . 1795.7 Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1805.8 Logical Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1825.9 Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1835.10 goto Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1875.11 Mathematical Functions . . . . . . . . . . . . . . . . . . . . . . . . . 1885.12 Bitwise Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1895.13 List Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1905.14 Associative Arrays Operations . . . . . . . . . . . . . . . . . . . . . . 1945.15 Pattern Matching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1955.16 Regular Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . 1965.17 Map Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1995.18 Two-Dimensional Arrays . . . . . . . . . . . . . . . . . . . . . . . . . 2005.19 Subroutines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2015.20 Recursion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2085.21 File Manipulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2135.22 Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Bibliography 223
ii
Search History:
Searching...
Result 00 of 00
00 results for result for
  • p.
  • Notes
    Load more