#!/bin/bash
usage="$0
if [[ $# -ne 1 ]];then
echo $usage
exit 1
fi
files=`find . -name "$1";`
if [[ -z $files ]];then
echo "$1 not found"
fi
count=0
for f in $files; do
((count += 1))
done
echo "Found $count files matching $1"
for f in $files; do
echo $f
echo -n "Enter [Open : y , quit : q , skip : any other char] "
read ans
if [[ $ans == "q" ]];then
break;
fi
if [[ $ans == "y" ]];then
vim $f
break;
fi
done