If you want it to run even faster, don't make it a script, but a function within your shell. Then when you call it, you are not spawning a new process to execute a new shell to run the script. Your interactive shell just does the work itself. This will be faster.
You can put a function, or many of them, into a file (e.g. "myFunctions.sh") and source the file, which essentially executes all commands in the file. In bash, you source a file with the command "."
e.g.:
. myFunctions.sh
I do like MarkL's take on the problem, but if you are not a regex expert (a regexpert?) then it can be hard to follow. Here is what I had come up with:
function do_fs_mode_get()
{
while read a b c d e f
do
if [ "$a" = "$1" ]
then
echo "FS: $a mode: ${d%%,*}"
return 0
fi
done < /proc/mounts
return 1
}