Sun Microsystems, Inc.
spacer spacer
spacer   Sun Educational Services  
spacer
black dot
  black fade
spacer
  Course Catalog
logo

Creating Basic UNIX Shell Scripts

( WT-1310-180 )


     Course DescriptionBack To Top

Course Offered in Partnership With DigitalThink

This course is designed for UNIX users who are ready to begin exploring the power and support available in the shell environment. This course covers the essential aspects of shell programming and provides an overview of the similarities and differences among the three most popular shells: the Bourne shell, the C shell, and the Korn shell.

This course requires a computer running Windows, Macintosh, or UNIX, and telnet software.

eMentoring Services are included with this course.

  • Course length: 8 hours

  • Course details
        id:      WT-1310-180
        subscription duration:  180 days
        list price:  $  325.00


     
         Languages Offered Back To Top

    This course is currently available in English only.

     
         Prerequisites Back To Top

    To succeed fully in this course, students should be able to:

  • Demonstrate completion of UNIX Fundamentals Bundle, or equivalent knowledge and experience
  •  
         Skills Gained Back To Top

    Upon completion of this course, you should be able to:

  • Define a shell program and how it interacts with your UNIX system
  • List the components that make up all shell scripts
  • Describe the differences between popular shells
  • Use different types of shell variables to hold data values
  • Create coherent script objectives and designs
  • Read and write files from within a script
  • Define appropriate tests for conditions in a script
  • Use different looping operations to control script flow
  • Redirect input and output to control how data is handled in a script
  •  
         Related Courses Back To Top

  • After: Advanced UNIX Shell Programming
  •  
         Course Content Back To Top



    Module 1: Course introduction Back To Top

  • Course introduction
  • Prerequisites
  • What you need
  • Course resources
  • Your learning community
  • Meet your instructor
  • The Course Project


  • Module 2: Defining shell programming Back To Top

  • Defining shell programming
  • What is a shell?
  • What shells are available?
  • Deciding which shell to program for
  • Shell scripts within UNIX
  • Interpreted and compiled programs
  • Understanding other scripting options
  • When to use a shell script, other script, or compiled program
  • Module wrap-up


  • Module 3: Components of a shell program Back To Top

  • Components of a shell program
  • A shell script as a macro
  • Components of a shell program: external and built-in commands
  • Tools to manage input and output
  • Tests
  • Variables
  • Components of a shell script: control structures
  • Regular expressions
  • Module wrap-up


  • Module 4: Writing your first script Back To Top

  • Writing your first script
  • An interactive "script" on the command line
  • Defining a script file
  • Using a text editor
  • A command to write to the screen
  • A command to read keyboard input
  • Including comments in shell scripts
  • Setting the file permissions
  • Running the script
  • Module wrap-up


  • Module 5: Working with variables Back To Top

  • Working with variables
  • Accessing command-line arguments
  • Using predefined system variables
  • Accessing environment variables
  • Creating your own variables
  • Variable interpretation
  • Using strings in variables
  • Using numbers in variables
  • Doing math with variables
  • Using array variables
  • Module wrap-up


  • Module 6: Designing more complex scripts Back To Top

  • Designing more complex scripts
  • Defining a script objective
  • Diagramming script flow
  • Deciding on tests and loops
  • Checking commands
  • Including error trapping
  • Making the script portable
  • Documenting the script
  • Module wrap-up


  • Module 7: Reading input and writing to files Back To Top

  • Reading input and writing to files
  • Using scripts with non-text files
  • Interacting with files through other commands
  • Retrieving user input with read
  • Reading data from a file
  • Writing text lines to a file
  • Printing formatted information
  • Storing structured data in a file
  • Module wrap-up


  • Module 8: Testing conditions Back To Top

  • Testing conditions
  • How to use if/then/else statements
  • Learning to use tests
  • Using Boolean operators
  • Testing file conditions
  • Testing numeric and string conditions
  • Using command results as tests
  • Nesting else statements
  • Using case statements in place of nested else
  • Module wrap-up


  • Module 9: Looping structures Back To Top

  • Looping structures
  • When to use loops
  • Defining a test to control a loop
  • Using for loops
  • Using while loops
  • Using select loops
  • Using until loops
  • Using break and continue to control flow
  • Module wrap-up


  • Module 10: Redirection Back To Top

  • Redirection
  • Defining STDIN and STDOUT
  • Defining STDERR
  • Reviewing output redirection
  • Appending output
  • Using input redirection
  • Using a pipe
  • Using a tee for redirection
  • Including redirected input within a script
  • Module wrap-up


  • Module 11: Course conclusion Back To Top

  • Course conclusion
  • Where do you go from here?
  • We'd love your feedback
  • Help us help you learn!

  • Terms of UsePrivacy PolicyFeedback Copyright 1994-2002 Sun Microsystems, Inc.