作者:777
源码
-----------------------------------------------------------------
#!/usr/local/bin/bash
#A script to find a keyword.
#Name findkey
while true;do
echo "Input directory: ( Will exit if you press e ! ) "
read dir
if [ $dir = "e" ];then echo "The process already exit !";exit 0;fi
if [ -e $dir ];then
echo -n "Input keyword: "
read "key"
grep -R "$key" $dir 2>/dev/null|less
else "The directory is not exist ! ";fi
done
原文地址
阅读(635) | 评论(0) | 转发(0) |