From: Nicolas Boisselier Date: Sat, 17 Sep 2016 17:50:18 +0000 (+0100) Subject: is_empty X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=e50b9e6462a4ac86ffeb47112fe7bb7702eab1b9;p=nb.git is_empty --- diff --git a/etc/profile.d/functions b/etc/profile.d/functions index ca00e197..1b18f889 100644 --- a/etc/profile.d/functions +++ b/etc/profile.d/functions @@ -551,7 +551,7 @@ boot_loader() { return 0 } -function is_empty() { [[ -z $(ls -A "/$1") ]]; } +function is_empty() { [[ -z $(ls -A "/$1" | head -1) ]]; } is_prompt() { #[[ $- == *i* ]] && echo "Interactive" || echo "Not interactive"