Created
January 22, 2019 01:52
-
-
Save jsakas/a46faf0ead1cd6ed4efe4c2916a37d8e 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 | |
# recursively walk directory | |
function traverse() { | |
for file in $(ls "$1") | |
do | |
#current=${1}{$file} | |
if [[ ! -d ${1}/${file} ]]; then | |
echo "${1}/${file}" | |
else | |
#echo "entering recursion with: ${1}${file}" | |
traverse "${1}/${file}" | |
fi | |
done | |
} | |
function main() { | |
traverse "$1" | |
} | |
main "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment