I have this script that will show the user the head or tail of the files that are inside a set directory (currently that is set as '~/bin/new/*').This script works but i would like to allow the user to not only show the head or the tail, but so that they can select the directory.The current script is written as:while true;doecho Would you like to list the head or tail?    read headortailif [[ $headortail = head ]]; then    head -n 4 ~/bin/new/*breakelif [[ $headortail = tail ]]; then    tail -n 4 ~/bin/new/*breakelse    echo Invalid Input - Please Input head or tailfidoneIf I add another line under the first echo such as:echo Please type the directory    read dirLocationHow could i implement this to the script, would I do:head -n 4 $dirLocationWould that work?
Head and Tail of a directory, set by the user
wildcards;tail;head