#!/bin/sh 


function t01
{
   # pattern matching example
   #
   #    variable#pattern
   #    variable%pattern
   #
   #  # deletes from left to right the pattern. 
   #  % deletes from right to left the pattern. 
   #  One symbol is first match, two is longest match.
   local path="/home/cam/book/long.file.name"
   echo ${path#/*/}
   echo ${path##/*/}
   echo ${path%.*}
   echo ${path%%.*}
   echo ${path%/*}
}

# List the directory names
function t02
{
   for i in `ls -p | grep /`; do
      echo ${i%/}
   done
}


# <TODO> copy directories recursively
# supply the file types eg .cpp .h .txt ...
# pass the destination directory at the command line
# have loop to transverse directories in current directory
# mkdir destination direcory before calling 
#    recursive function to go there.

