Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Recursively traverse a filesystem
#! /bin/sh
rec() {
for f in `ls $2`; do
echo $1 $f
if [ -d "$2/$f" ]; then
rec $1-- "$2/$f"
fi
done
}
rec "|--" $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.