Linux as a Tool

Linux as a Tool

Linux isn't really an operating system. Let me put that another way: Linux is more than an operating system ”or less ”or not.

You may think I'm confused , but I'm not. You see, pundits throughout the computer industry have been predicting the death of Unix since it was created. Bill Gates and company of Microsoft are merely the latest in a series of computer industry powers who wanted the future to come to their platform and, in an effort to do so, have either dismissed Unix or claimed that their product is better than Unix or done both at once. The claim that Windows NT "will be a better Unix than Unix" serves more to indicate the durability of Unix than the benefits of a new version of Windows.

So why does Unix not die? With a series of industry powerhouses gunning for it and a number of legitimate criticisms out there, one would think predicting the end would be a safe thing, with only the dying day uncertain . But it isn't so.

Unix (and, by extension, Linux) is not the best at anything. It isn't the easiest to understand. It isn't the fastest . It isn't the richest in features for business, science, or mathematics. So, for the final rhetorical time, why does it live on? Because, in spite of centuries of progress, of science and engineering, of decades of electronics and miniaturization, if you have a board and a nail you still want a hammer to make them work together. I haven't seen a digital hammer worth the price.

Linux is a tool. In fact, the metaphor we have chosen is, I think, a very apt one. Linux is the multitool of computing. We certainly cannot take credit for inventing this metaphor (I've been hearing it for years now), but we do intend to prove the truth of it.

Unix, and the "Unix way" of doing things, has produced tools that allow you to do things that are quite simply impossible on other platforms. For example, can your operating system do this?

  $ perl -e 's/http:\/\/www.reknown.org\/playbyplay\//http:\/\/www.play.org\//gi' -p -i.bak *.html  

Now, I will be the first to admit that this is an intimidating-looking command line. What does it do? Suppose you have a large and complex Web site and you have many links to another Web site, whose current URL begins:

http://www.reknown.org/playbyplay

You have just learned that everything at "playbyplay" and below is moving to its own server at:

http://www.play.org/

You've got over 100 links to the old address scattered over 30 html files! What do you do? Well, you type in that first command, which will find and replace every occurrence of the old base URL with the new base URL in all the html files in the current directory all at once. It will leave behind unchanged files with the same name but with a new ".bak" extension. Try that with Notepad or MS Office!

But wait, there's more. Put that command line in a shell script named movelink that looks like this:

  #!/bin/bash  
   
  cd  
  perl -e 's/http:\/\/www.reknown.org\/playbyplay\//http:\/\/www.play.org\//gi' -p -i.bak *.html  

Now you can make that change to any directory on your system by typing the directory name as the first command line argument:

  $ movelink /var/www  

Now how much would you pay? But wait, there's more! Suppose you wanted to do that for your whole Web site at once. Supposing that Web site begins at /var/www, you could now do that with this command line:

  $ find /var/www -type d -exec movelink {} \;  

Now, granted, Perl is not Linux, or even Unix, but Perl is very, well, Unix-y. You see, the Linux kernel and all the GNU (and other) tools that run with it are based on decades of experience in doing the real-world things that programmers and IT professionals have found themselves doing repetitively. At this point, whenever I hear someone over a cubicle wall typing the same keystrokes over and over again (Up-arrow, del, del, Up-arrow, del, del, etc.), I take the opportunity to offer to help. With vi, or sed, or awk, or Perl, I am usually able to do in one command line what this person was doing with mind-numbing repetition. You are sitting at a computer, for goodness sake! It should do the repetitive work for you.

Unix does not die, because it provides a rich set of tools and a way to combine those tools rapidly to make new and more powerful tools.

To some, Linux is just a kernel that provides a base set of services and APIs. To us, Linux (and Unix) are a philosophy of computer operation and programming. Installing Linux is the computer equivalent of getting a complete wood, metals, and automotive shop, absolutely jammed full of the finest, shiniest, best tools you can buy. And the best part is you didn't have to buy it.

 



Multitool Linux. Practical Uses for Open Source Software
Multitool Linux: Practical Uses for Open Source Software
ISBN: 0201734206
EAN: 2147483647
Year: 2002
Pages: 257

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net