@Caleb - this answer is a modification to PeterMmm's original script to demonstrate how a shell function ...
stackoverflow.com