#!/bin/sh if test $# -ne 2; then echo "usage: $0 absoluteDir number" exit 1 fi case $1 in /*) ;; *) echo "error: $1 is not absolute!" exit 2 ;; esac test $2 -gt 1 1>/dev/null 2>/dev/null case $? in 0) ;; *) echo "error: $2 is not a number or not strictly bigger than 1" exit 3 ;; esac PATH=$PATH:`pwd` export PATH echo -n "" > /tmp/tmpcounter slave.sh $* n=`cat /tmp/tmpcounter | wc -l` echo "$n dirs found..." exit 0