Chinaunix首页 | 论坛 | 博客
  • 博客访问: 28535584
  • 博文数量: 2065
  • 博客积分: 10377
  • 博客等级: 上将
  • 技术积分: 21525
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-04 17:50
文章分类

全部博文(2065)

文章存档

2012年(2)

2011年(19)

2010年(1160)

2009年(969)

2008年(153)

分类: LINUX

2010-06-27 21:11:21

作者: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

 原文地址
阅读(627) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~