CS206 Assignment 1 Solutions


Table of Contents
Documentation Inserter
User Tracker
News Tracker
Web Snooper

Documentation Inserter

#!/bin/sh

# there is no error handling; assume we were called correctly

find -name "*$2" ! -type d -print | while read file
do
        case $file in
        $1) 
                ;; # don't insert the doc file into itself
        *)
                cat $1 $file > /tmp/doc$$.tmp
                mv -f /tmp/doc$$.tmp $file
                ;;
        esac
done