Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 503 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
503
Dung lượng
5,71 MB
Nội dung
[...]... Using find | xargs vs Perl alternatives 192 Using Perl for reliable timestamp sorting 193 Dealing with multi-word filenames 196 6.6 find as an argument pre-processor for Perl 197 6.7 A Unix- like, OS-portable find command 198 Making the most of find 2perl friends with find 2perl 199 198 ✦ Helping non -Unix 6.8 Summary 200 Directions for further study Part 2 201 Minimal Perl: for UNIX and Linux Shell Programmers... needlessly complex and too hard to learn Minimal Perl was created to address these obstacles presented by Perl s redundancy and complexity By emphasizing Perl s grep, sed, and awk-like features, and relying 1 Before you despair, I should point out that Minimal Perl uses only 2 of these variations—which is all anybody needs! xix on concepts such as inputs, filters, and arguments, it allows Unix1 users to... confirmed my hunch that many were hungering for an easier way to learn Perl Since then, I’ve taught Minimal Perl at other professional conferences, at meetings of Perl Users Groups in the US and Canada, and to many Fortune 500 companies THE GENESIS OF THE BOOK By 2001, the Minimal Perl approach had convincingly proven its ability to help Unix people acquire Perl skills with relative ease But many who... 33 Shell and Perl techniques for writing messages to STDOUT and STDERR 36 Special variables for I/O operations 42 Special variables for formatting output 43 Standard option clusters for Perl commands and scripts 45 3.9 3.10 3.11 3.12 Chapter 3 String escapes for representing control... file-management techniques, and command formats used on Unix systems For example, you should know how to view the contents of text files, how to change the current directory without getting lost, and how to use the grep command to extract matching lines from a file Readers with more extensive backgrounds in Shell programming can especially benefit from part 2 Part 2: Perl for UNIX and Linux Shell programmers... understanding of Perl than almost anyone else To allow others to benefit from his insights, I arranged for him to periodically teach Perl classes through my Seattle-based company (Consultix) and also to present talks to our Seattle Perl Users Group (SPUG, aka Seattle.pm) This worked out wonderfully for Seattleites, who would learn practical Perl incantations 1 2 3 4 xx In this book, Unix is shorthand for. .. Directions for further study 51 3 Perl as a (better) grep command 53 3.1 A brief history of grep 53 3.2 Shortcomings of grep 54 Uncertain support for metacharacters 54 ✦ Lack of string escapes for control characters 56 ✦ Comparing capabilities of greppers and Perl 57 3.3 Working with the matching operator 60 The one-line Perl grepper 3.4 3.5 3.6 3.7 61 Understanding Perl s regex notation 63 Perl as a... manual for the Perl language • Larry—Larry Wall is the amazing guy who invented the original Perl and who continues to be its major architect and contributor As an expression of admiration for his creative brilliance and gratitude for his generous gift of Perl to the world, he has been awarded a special honor by members of the Perl community: We refer to him simply as “Larry,” as you’d refer to Elvis and. .. showing how Perl has evolved Unix into a dialect that is much more powerful but also much easier to use If you’re already fluent in Perl s mother tongue, and you want to discover how expressive and poetic Perl itself can be, you could have chosen no better primer than this book and no better guide than Dr Tim Maher, a gifted teacher and a decorated veteran of both the Unix world and the Perl community... Metacharacters for alternation, grouping, match capturing, and match referencing in greppers and Perl 71 Quantifier metacharacters 73 Examples of matching across lines 78 Patterns for the shortest and longest sequences of anything or something 78 Unix and Perl commands for . class="bi x0 y0 w0 h0" alt="" Minimal Perl Minimal Perl For UNIX and Linux People BY TIM MAHER MANNING Greenwich (74° w. long.) For online information and ordering of this and other Manning books,. a (better) grep command 53 4 Perl as a (better) sed command 89 5 Perl as a (better) awk command 121 6 Perl as a (better) find command 178 Part 2 Minimal Perl: for UNIX and Linux Shell Programmers. xxxv Part 1 Minimal Perl: for UNIX and Linux Users 1 1 Introducing Minimal Perl 3 1.1 A visit to Perlistan 3 Sometimes you need a professional guide 5 1.2 Perl can be simple 7 1.3 About Minimal Perl