Chapter 4: Tweaking Unix


The outsider view of Unix suggests a nice, uniform command-line experience, helped along by the existence of and compliance with the POSIX standards for Unix. But anyone who's ever touched more than one computer knows how much they can vary within these broad parameters.

You'd be hard-pressed to find a Unix or Linux box that doesn't have ls as a standard command, for example, but does your version support the -- color flag? Does your system use the older inetd package for launching daemons, or does it use xinetd ? Does your version of the Bourne shell support variable slicing (e.g., ${var:0:2} )?

Perhaps one of the most valuable uses of shell scripts is to fix your particular flavor of Unix and make it more like other flavors, in order to make your commands conform with those of different systems. Although most of the modern, fully featured GNU utilities run just fine on non-Linux Unixes (so you can replace clunky old tar binaries with the newer GNU tar , for example), many times the system updates involved in tweaking Unix don't need to be so drastic and don't need to introduce the potential problems inherent in adding new binaries to a supported system. Instead, shell scripts can be used to map popular flags to their local equivalents, to use core Unix capabilities to create a smarter version of an existing command, or even to address the longtime lack of a certain facility.

Wicked Cool Shell Scripts. 101 Scripts for Linux, Mac OS X, and Unix Systems
Wicked Cool Shell Scripts
ISBN: 1593270127
EAN: 2147483647
Year: 2004
Pages: 150
Authors: Dave Taylor © 2008-2017.
If you may any questions please contact us: