Last active
April 19, 2017 08:51
-
-
Save nodew/4d30917bfa15bf61378e1beffa8bffcd to your computer and use it in GitHub Desktop.
recursively find out all file under a folder
This file contains 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
path=$1 | |
ignoreFolder=$2 | |
walk() { | |
ss=${1#*${2}} | |
if [[ $ss == "" ]]; then | |
return | |
fi | |
if [[ -d $1 ]]; then | |
sub=`ls $1` | |
for f in $sub | |
do | |
p=`echo ${1}/${f}` | |
walk $p $2 | |
done | |
elif [[ -f $1 ]]; then | |
echo $1 | |
fi | |
} | |
walk $path $ignoreFolder |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment