From 5c26ac471e407c3739089010be9a83b57c5194e0 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Mon, 8 Jul 2013 17:46:33 -0700 Subject: [PATCH] error-handling in dbusiest --- sh/cdbusiest | 1 + sh/dbusiest | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sh/cdbusiest b/sh/cdbusiest index a925cc6..44a2524 100644 --- a/sh/cdbusiest +++ b/sh/cdbusiest @@ -1,4 +1,5 @@ #!/bin/zsh dbusiest | read -r c d +[ -z $c ] && return 1 <<<"$c $d" cd $d diff --git a/sh/dbusiest b/sh/dbusiest index 2b38e80..de6403e 100644 --- a/sh/dbusiest +++ b/sh/dbusiest @@ -1,7 +1,8 @@ #!/bin/zsh local c d -for d in *(FD); do +for d in *(FDN); do print $(find $d 2>/dev/null | wc -l) $d done | sort -nr | while read c d; do echo -E $c $d done +[ -z $d ] && return 1