Prevent hang.
authorIain Patterson <me@iain.cx>
Tue, 11 Jun 2013 14:20:24 +0000 (15:20 +0100)
committerIain Patterson <me@iain.cx>
Thu, 13 Jun 2013 09:30:50 +0000 (10:30 +0100)
If ls produced no output the grep could hang.

.profile.d/ls.bashrc

index 88e76e0..c3c6e21 100644 (file)
@@ -7,7 +7,7 @@ if echo "$ls" | grep gnu.org >/dev/null; then
   eval `dircolors 2>/dev/null` 2>/dev/null
 
   LS_OPTIONS="--color=auto -F -b"
-  if echo $ls | grep -- --time-style >/dev/null; then
+  if echo "$ls" | grep -- --time-style >/dev/null; then
     LS_OPTIONS="$LS_OPTIONS --time-style=long-iso"
   fi
   export LS_OPTIONS