#!/bin/sh # svndirs -- list all the subdirectories of the current directory # that are SVN directories # # SUMMARY: If the current directory is a SVN directory, # then it outputs . ; # otherwise, it lists on stdout all the immediate subdirectories # of . that are SVN directories (with relative pathnames). # # AUTHOR: Gary T. Leavens [ -n "$echo" ] && set -x USAGE='svndirs' # svndirs -- Print all immediate subdirectories that are SVN directories # This only prints relative directory names. svndirs() { # no parameters if test $# -ne 0 then echo "$USAGE" >&2 exit 2 fi if test -d .svn then echo . else SUBDIRS=`echo */.svn` if test "$SUBDIRS" \!= '*/.svn' then echo "$SUBDIRS" | sed -e 's@/.svn@@g' fi fi } svndirs $*