21 Jan
2011
21 Jan
'11
21:50
On Friday 21 January 2011 04:11:41 David Haller wrote:
num_subdirs() { for dir; do nlinks=$(stat -c '%h' "$dir"); subdirs=$(( $nlinks - 2 )); ### printf "'%s' has %d subdirectories.\n" "$dir" "$subdirs";
On the subject of portability, there are systems where it is possible to create a hardlink to a directory (e.g. Mac OS X), so your answer may not be correct on all systems. Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org