Bash Shell Scripting
Crash Course
crowfly.net

<<   >>

Introduction

GNU_Tools

Example1

Example2

Execution_bit

Bang_bin_bash

Example3

The_dot

Example4

Example5

Example6

Example7

Example8

Background

Forking

Example9

Bash_profile

Pattern_match

Regex

Debug

Gory_details

References

<<   >>
Debugging

To debug you use:

  set -x
  set +x

Here it is being used in this script: ediff

  myhost=100.100.100.100
  elog=/var/log/apache2/error_log
  tmp_elog=/tmp/elog_$USER
  echo 
  set -x
  diff $tmp_elog $elog | \
    sed -e "s/^.*$myhost] //" \
                -e "s/, referer: .*$//" |\
    more
  set +x
  cp $elog $tmp_elog
  

And the output looks like this:

  dlink@viddev1> ediff
  ++ sed -e 's/^.*10.97.9.170] //' -e 's/, referer: .*$//'
  ++ more
  ++ diff /tmp/elog_dlink /var/log/apache2/error_log
  ++ set +x