O'Reilly logo

Beginning, Mac OS® X Snow Leopard™ Programming by Drew McCormack, Michael Trent

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 12. The Bash Shell

WHAT YOU WILL LEARN IN THIS CHAPTER:

  • How to configure and use Bash interactively and for running scripts

  • How to use the Terminal application for accessing the command line

  • The most important Unix commands and where to find information about commands

  • Some of the commands that are available only on Mac OS X

  • Basic shell programming

At the heart of every Mac OS X system is a Unix core. If you don't look for it, you won't see it, but it's there. As with all Unix systems, Mac OS X relies heavily on shell scripts. When you log into your account at startup — whatever you happen to be doing on Mac OS X — chances are good that a shell script is involved in some way.

After reading Chapter 11, you know that scripts are simple programs that string together Unix commands to perform a task. Scripts are run by a program called a shell, which interprets one line of code at a time. On Mac OS X, the default shell is called Bash, which is a powerful shell that can be used interactively or to run scripts. Upon completing this chapter, you should have a good basis for working with the Bash shell.

GETTING STARTED

Before you can start interacting with the operating system via the Terminal application or writing your own shell scripts, some preliminaries need to be taken care of. First, you need to know what a command-line interface (CLI) is and the different ways in which it can be used. You need to have an application that can access the CLI and a way to edit scripts and other text files. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required