LinuxCommand
Learning the shell
Script library
SuperMan pages
Who, What, Where, Why
|
Here is where the fun begins
By Williams Shotts, Jr.
With the thousands of commands available for the command line user, how can you
remember them all? The answer is you don't. The real power of the computer is its
ability to do the work for you. To do that, we use the power of the shell to automate
things. We write scripts.
Scripts are collections of commands that are stored in a file. The shell can read
this file and act on the commands as if they were typed at the keyboard. In
addition to the things you have learned so far, the shell also provides a variety of
useful programming features to make your scripts truly powerful.
What are scripts good for? A wide range of tasks can be automated. Here are
some of the things I automate with scripts:
- A script gathers up all the files in this site (over 1900) on my computer
and transmits them to my web server.
- The SuperMan pages are built entirely
by a script.
- Every Friday night, all my computers copy their files to a "backup server"
on my network. This is performed by a script.
- A script automatically gets the current
updates from my Linux vendor and maintains a repository of vital updates.
It sends me an email message with a report of tasks that need to be done.
As you can see, scripts unlock the power of your Linux machine.
So let's have some fun!
Contents
- Writing your first script and getting it to work
- Writing a script
- Setting permissions
- Putting it in your path
- Editing the scripts you already have
- Commands, commands, everywhere
- Aliases
- Shell functions
- type
- .bashrc
|