Thursday, April 12, 2012

Insert and Search


clear
echo "Enter your file name:"
read fn
search=` find $fn `
if [ $fn = $search ]
then
echo "Enter your word to be searched:"
read se
word=`fgrep -a -o -m 1 $se $fn`
if [ $se = $word ]
then
choice=`zenity --list \
--title="search result" \
--column= " "\
"sucess-found the specified word"`
else
choice=`zenity --list \
--title="search result" \
--column=" "\
"failed-specified word not found"`
fi
else
choice=`zenity --list \
--title="error" \
--column=" "\
"failed-file not found"`
fi

No comments:

Post a Comment