You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

24 lines
296 B

#!/bin/sh
DEPTH=${1:-4}
set -eu
ls_r() {
local count="$1" base="$2"
local x= d=
shift 2
count=$(($count - 1))
[ $count -gt 0 ] || return
[ ! -e "$base/.git" ] || echo "${base#./}"
for d in "$base"/*; do
if [ -d "$d" ]; then
ls_r $count "$d" &
fi
done
wait
}
ls_r "$DEPTH" .