源码 ----------------------------------------------------------------- #!/usr/local/bin/bash #A bash 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