All pastes #585424 Raw Edit

Something

public text v1 · immutable
·published 2007-06-23 07:43 UTC
rendered paste body
function foo () {
src=""
if [[ -z $1 ]]; then
        print Search: You must enter the name of the file to search for.
elif [ $3 ]; then
        print Search: Too many arguments supplied.
elif [[ -z $2 ]]; then
        src=$PWD
        file=$1
else
        src=$1
        file=$2
fi
if [[ $src != "" ]]; then
        print Search: Searching for $file in $src ...
        file="'*$file*'"
        find $src -iname $file
fi
}