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

Arguments to 'printf'

Escape sequences

\\ \ (backslash)
\a 'alert' (bell)
\b 'backspace' (moves cursor left one space)
\f 'formfeed' (skips one 'page' if possible)
\n 'newline' sequence
\r 'carriage return' (moves cursor to start of current line)
\t 'tab'
\v 'vertical tab'

Conversion characters

d integer (printed in decimal, base 10)
o integer (printed in octal, base 8)
x integer (printed in hexadecimal, base 16)
s string
c character

Copyright © 2002 Mike Joy, Stephen Jarvis and Michael Luck