Main index

Introducing UNIX and Linux


Introduction to shells

Overview
Why do we need a shell?
Shell syntax
      Types of shell command
      Simple commands
      Pipelines
      Grouping commands
      Exit status
      List commands
Arithmetic
      Operators and functions
Making decisions
      The 'test' statement
            Operators used by 'test'
      The 'if' statement
Loops
      'For' loops
      'While' and 'until' loops
Searching for files
      Arguments to 'find'
Formatted output
      Arguments to 'printf'
Passing information to scripts
      Scripts with arguments
      Parameter expansion
Summary
Exercises

Operators and functions

Operators used by bc are:

+ addition
- subtraction
* multiplication
/ division
% integer remainder
^ power

Functions used by bc are:

sqrt square root
length number of decimal digits
scale scale
s sine, requires option -l
c cosine, requires option -l
a inverse tangent, requires option -l
e exponential, requires option -l
l natural logarithm, requires option -l

Copyright © 2002 Mike Joy, Stephen Jarvis and Michael Luck