|
||
|
|
|
An Introduction to Tiger Terminal, Part 4by Mary Norbury-Glaser09/09/2005 In parts one, two, and three of this series, we covered basic commands that can be executed through the OS X Tiger Terminal app. Today, I'll take a bit of a leap and introduce shell scripting. What are shell scripts, and why would you want to create them? Well, if you begin to use the Terminal with regularity, you'll find that you are repeating many of the same commands, often in sequence, in order to accomplish some task. You can automate these tasks by writing a shell script file. What You Need To Know--And DoIn part one of this series, we ran the You'll also need a text editor to write your scripts. In part one, I introduced Mac OS X Tiger's new default text editor, Let's assume you'll be creating shell scripts on a regular basis, so it's the best practice to create a directory where you'll save all your scripts. Create a new folder in your /Documents directory and name it scripts. From the Terminal command line, now! norburym15:~ norburym$ Remember that your default location when you open the Terminal app is your home directory. Here, you've changed into your Documents directory and then created a new directory (folder) called scripts, using the
The next thing you'll want to do is tell the shell where to find this directory. You'll do that by adding the location of your new scripts directory to the
However, to set user-specific configuration variables, it's best to create a file in your own home directory that You can see your current norburym15:~ norburym$
|
Sponsored by: |
Copyright © 2000-2005 O’Reilly Media, Inc. All Rights Reserved. All trademarks and registered trademarks appearing on the O'Reilly Network are the property of their respective owners. For problems or assistance with this site, email |