Navigation: Homepage | xmlgawk | Buchkritik | Sitemap

Titel

Wicked Cool Shell Scripts

Wertung

Zitrone

Die Scripts darin haben alle Macken, die Notation ist inkosistent. Nicht empfehlenswert, obwohl es auch ein paar gute Sachen enthält.

Hauptthema

Nützliche Shell Scripte

Kapitelstruktur

 Chapter 1: The Missing Code Library
   #1 Finding Programs in the PATH
   #2 Validating Input: Alphanumeric Only
   #3 Normalizing Date Formats
   #4 Presenting Large Numbers Attractively
   #5 Validating Integer Input
   #6 Validating Floating-Point Input
   #7 Validating Date Formats
   #8 Sidestepping Poor Echo Implementations
   #9 An Arbitrary-Precision Floating-Point Calculator
   #10 Locking Files
   #11 ANSI Color Sequences
   #12 Building a Shell Script Library
   #13 Debugging Shell Scripts
 Chapter 2: Improving on User Commands
   #14 Formatting Long Lines
   #15 Archiving Files As They're Removed
   #16 Working with the Removed File Archive
   #17 Logging File Removals
   #18 Displaying the Contents of Directories
   #19 Locating Files by Filename
   #20 Emulating Another Environment: DIR
   #21 Digging Around in the Man Page Database
   #22 Displaying the Time in Different Time Zones
 Chapter 3: Creating Utilities
   #23 A Reminder Utility
   #24 An Interactive Calculator
   #25 Checking the Spelling of Individual Words
   #26 Shpell: An Interactive Spell-Checking Facility
   #27 Adding a Local Dictionary to Spell
   #28 Converting Temperatures
   #29 Calculating Loan Payments
   #30 Keeping Track of Events
 Chapter 4: Tweaking Unix
   #31 Displaying a File with Line Numbers
   #32 Displaying a File with Additional Information
   #33 Wrapping Only Long Lines
   #34 Emulating GNU-Style Flags with Quota
   #35 Making sftp Look More Like ftp
   #36 Fixing grep
   #37 Working with Compressed Files
   #38 Ensuring Maximally Compressed Files
 Chapter 5: System Administration: Managing Users
   #39 Analyzing Disk Usage
   #40 Reporting Disk Hogs
   #41 Figuring Out Available Disk Space
   #42 Improving the Readability of df Output
   #43 Implementing a Secure Locate
   #44 Adding Users to the System
   #45 Suspending a User Account
   #46 Deleting a User Account
   #47 Validating the User Environment
   #48 Cleaning Up After Guests Leave
 Chapter 6: System Administration: System Maintenance
   #49 Tracking Set User ID Applications
   #50 Setting the System Date
   #51 Displaying Which Services Are Enabled
   #52 Killing Processes by Name
   #53 Validating User crontab Entries
   #54 Ensuring That System cron Jobs Are Run
   #55 Rotating Log Files
   #56 Managing Backups
   #57 Backing Up Directories
 Chapter 7: Web And Internet users
   #58 Calculating Time Spent Online
   #59 Downloading Files via FTP
   #60 Tracking BBC News with lynx
   #61 Extracting URLs from a Web Page
   #62 Defining Words Online
   #63 Keeping Track of the Weather
   #64 Checking for Overdue Books at the Library
   #65 Digging Up Movie Info from IMDb
   #66 Calculating Currency Values
   #67 Tracking Your Stable-of-contentsk Portfolio
   #68 Tracking Changes on Web Pages
 Chapter 8: Webmaster Hacks
   #69 Seeing the CGI Environment
   #70 Logging Web Events
   #71 Building Web Pages on the Fly
   #72 Processing Contact Forms
   #73 Creating a Web-Based Photo Album
   #74 Building a Guest Book
   #75 Creating a Text-Based Web Page Counter
   #76 Displaying Random Text
 Chapter 9: Web and Internet Administration
   #77 Identifying Broken Internal Links
   #78 Reporting Broken External Links
   #79 Verifying Spelling on Web Pages
   #80 Managing Apache Passwords
   #81 Synchronizing Directories with FTP
   #82 Synchronizing to a Remote Directory via FTP
   #83 Synchronizing Files with SFTP
 Chapter 10: Internet Server Administration
   #84 Exploring the Apache access_log
   #85 Understanding Search Engine Traffic
   #86 Exploring the Apache error_log
   #87 Avoiding Disaster with a Remote Archive
   #88 Mirroring a Website
   #89 Tracking FTP Usage
   #90 Monitoring Network Status
   #91 Renicing Tasks by Process Name
   #92 Adding New Virtual Host Accounts
 Chapter 11: Mac OS X Scripts
   #93 List NetInfo? Users
   #94 Adding a User to a Mac OS X System
   #95 Adding an Email Alias
   #96 Set the Terminal Title Dynamically
   #97 Producing Summary Listings of iTunes Libraries
   #98 Fixing the Open Command
 Chapter 12: Shell Script Fun and Games
   #99 Unscramble: A Word Game
   #100 Guess the Word Before It's Too Late: Hangman
   #101 A State Capitals Quiz

Verständlichkeit, Sprache

Man merkt deutlich, dass der Autor viele Jahre Erfahrung im Schreiben hat. Es liest sich gut.

Was ist die Botschaft? Motivation und Begründung

Dave Taylor ist ein echter Unix Fan und möchte dem Leser die Shell Programmierung und vor allem die leichte Anpassbarkeit der Unix Umgebung anhand von vielen Beispielen näher bringen. Da wir uns schon lange nicht mehr in den 80er oder 90er Jahren befinden, macht er das anhand der POSIX Shell. Seine Scripte laufen unter bash (Linux, *BSD, Mac OS X) und /usr/xpg4/bin/sh (Solaris, vermutlich laufen die auch unter /bin/ksh).

Meine Meinung

Wenn diese Scripte wirklich "cool" sind, dann ists um die Gilde der Shell Programmierer geschehen. In fast jedem Script gibt es -- aus meine Sicht -- etwas auszusetzen. Inkonsistent und unschön. Zum Beispiel erfindet er in #30 "Keeping Track of events" das gute alte calendar(1) wieder neu; was soll das? Ausserdem ist fasst jedes zweite seiner Scripten interaktiv, d.h. es verwendet Shells read. Interaktive sollte man aber gleich mit GUI bauen, Scripte mit Optionen.

Einige Sachen haben mir gut gefallen, z.B. predigt der Autor den Eoinsatz von POSIX Shell, statt der Bourne Shell. Das ist gut, richtig und wichtig. Auch hat er ein paar schöne Features von 'lynx' aufgezeigt. Dieses kleine 'sed' Script zur Massage von XML Files ist nett:

 sed 's/</\n</g;s/>/>\n/g'
Klein und effektiv -- warum bin ich da nie selber drauf gekommen...

Autor(en)

Dave Taylor

Erscheinungsjahr, Verlag, ISBN, Seitenzahl

2003, No Starch Press, ISBN 1-59327-012-7, 341 Seiten

URLs

Amazon: http://www.amazon.de/exec/obidos/ASIN/1593270127

Verlag: http://www.nostarch.com/wcss.htm

Autor: http://www.intuitive.com/wicked/

Schlagworte

Bourne Shell, bash, ksh, POSIX Shell, lynx

Datum

08-May-2004

last modified: $Date: 2004/05/13 20:04:05 $