IT 244: Introduction to Linux/Unix
Class 18

Review


New Material


Microphone

Homework 8

I have posted Homework 8 here.

As usual, it will be due next Sunday at 11:59 PM.

Quiz 6

I have posted the answers to Quiz 6 here.

Hashbang Line and Comments in Assignments

You will not have to include a hashbang line in homework assignments until homework 11.

Homework 11 is the last homework assignment.

You should use the following as your hashbang line in that assignment

#! /bin/bash 

For homework assignments 8, 9 and 10 you will only need to write the usual Step comments.

For homework 11 you will also have to write a comment at the top of each script.

This comment should describe what the program does.

You will have to write hashbang lines and comments in Class Exercises 23-26.

Questions

Are there any questions before I begin?

Review

Running a Startup File after a Change has been Made

Commands that are Symbols

( ) Runs whatever commands are enclosed in the parentheses in a sub-shell
$( )Command substitution:
runs the commands enclosed in the parentheses in a subshell and returns their value to the command line, replacing the dollar sign, the parentheses and everything in them with this value
(( ))Evaluates an arithmetic expression:
by default, Unix treats everything as text, but this command evaluates whatever it encloses as a numerical, rather than a string, expression
$(( ))Arithmetic expansion:
evaluates an arithmetic expression and returns its value at that place on the command line
[ ]The test command:
used to evaluate a boolean expression in constructs like if clauses
[[ ]]The conditional expression:
similar to [ ] but adds string comparisons

File Descriptors

Redirecting Standard Error

Shell Scripts

Making a Shell Script Executable

Specifying Which Version of the Shell Will Run a Script

Comments in Shell Scripts

Attendance

New Material

Variables

Creating a Variable

Scope

Local Variables

Global Variables

Choosing the Scope of a Variable

Defining Global Variables

Keyword Shell Variables

Important Keyword Shell Variables

User-created Variables

The read command

env - Show All Global Variables

Separating and Grouping Commands

| (pipe) and & (ampersand) as Command Separators

Continuing a Command onto the Next Line

Using Parentheses, ( ) , to Run a Group of Commands in a Subshell

The Directory Stack

pushd - Pushes a Directory onto the Stack

popd - Pops a Directory off the Stack

dirs - Displays the Directory Stack

Class Exercise

Class Quiz