#!/bin/bash
if [ $1 != "" ];then
words=$@
echo "${words}"
echo "Results"
echo "---------------------------------------------------------------------------"
echo $'\n'
for fn in *.txt
do
grep "${words}" ${fn} -n --color=always -2 -i
ret=$?
if [ ${ret} -eq 0 ]
then
echo ---------------------------------------------------------------------------in ${fn};
echo $'\n'
fi
done
else
echo "there is no argument"
fi
0 件のコメント:
コメントを投稿