Skip to content

Instantly share code, notes, and snippets.

@jsakas
Created January 22, 2019 01:52
Show Gist options
  • Save jsakas/a46faf0ead1cd6ed4efe4c2916a37d8e to your computer and use it in GitHub Desktop.
Save jsakas/a46faf0ead1cd6ed4efe4c2916a37d8e to your computer and use it in GitHub Desktop.
#!/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