Last active
January 26, 2017 04:03
-
-
Save roc26002w/109ba5e3864d4e5e9ee20c053f60a997 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function gateFile(){ | |
for file in $1 | |
do | |
if [ -d "${file}" ] | |
then | |
gateFile "${file}/*" | |
fi | |
if [ -f "${file}" ] | |
then | |
grep -rnw "${file}" -e "search text" | |
#echo "get file and fine name is ${file}" | |
fi | |
done | |
} | |
gateFile $1 | |
方案二 : | |
# 每個目錄都會進去搜尋 `productcategory` 字串 | |
find -L . -exec grep -i productcategory {} + |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment