Copy Code code as follows:
#!bin/sh
# Find the file for the specified suffix at the specified location, including subdirectories
Usage
# FINDF $ $
# The first parameter is a suffix
# Find the file for the specified suffix and print it out
# link:www.jb51.net
# DATE:2013/2/26
F ()
{
list= ' Find $2|grep '/.$1/> '
For I in $list
Todo
Echo $i
Done
}
# Print Usage
Print ()
{
echo "Usage:"
echo "$/$1/$2"
echo "The first parameter is the specified suffix name, such as ' H '"
echo "The second parameter is the specified directory, and if omitted this argument defaults to the current directory"
Exit-1
}
# Find in current directory
F1 ()
{
F "$" "*"
}
# in the specified directory to find
F2 ()
{
CD $
F "$" "*"
}
If ["$#"-lt "1"]
Then
echo "Given too few parameters, at least one parameter is required."
Print "$"
Fi
If ["$#"-GT "2"]
Then
echo "There are too many parameters given, up to two parameters."
Print "$"
Fi
If ["$#"-eq "1"]
Then
F1 $
Exit 0
Fi
If ["$#"-eq 2]
Then
F2 $ $
Exit 0
Fi