Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Shell Script Basics

Writing a shell script is like riding a bike. You fall off and scrape your knees a lot at first, but once you are sufficiently experienced, you’ll understand why people drive cars. If you have ever successfully trued a bicycle wheel, that’s similar to knowing the basics of shell scripting. If you don’t true your scripts, they wobble.

This chapter introduces basic concepts of shell scripting. It was not intended to be a complete reference on writing shell scripts, nor could it be. It does, however, provide a good starting point for beginners first learning this black art.

Contents:

Shell Script Dialects
She Sells C Shells
Tips for Shell Users
Shell Variables and Printing
Exporting Shell Variables
Shell Script Input and Output Using printf and read
Bulk I/O Using the cat Command
Pipes and Redirection
Basic Control Statements
Variables, Expansion, and Quoting




< Previous PageNext Page > Hide TOC


Last updated: 2008-04-08




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice