#! /bin/zsh

# simple wrapper to run both find and grep
# usage: gfind <search-term> [search-directory]
# if no search-directory given, uses . by default

searchTerm=$1
searchDirectory=$(if [[ -n $2 ]] then echo $2; else echo "."; fi)

printf '//// find results for: %s in directory: %s\n' $searchTerm $searchDirectory
find $searchDirectory -iname "*$searchTerm*"

printf '\n//// grep results for: %s in directory: %s\n' $searchTerm $searchDirectory
grep -rIi $searchTerm $searchDirectory
