summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2016-12-01 16:03:07 +0100
committerFlorian Pritz <bluewind@xinu.at>2016-12-01 16:03:07 +0100
commit878f2b65cc13c38d69d5c98a15cd17130da08d32 (patch)
tree2b34d5ca33380f3f722435dd51105c3203452f85
parente02338e5c58a4287adb649fd196d3a4864ef1d2c (diff)
downloadbin-878f2b65cc13c38d69d5c98a15cd17130da08d32.tar.gz
bin-878f2b65cc13c38d69d5c98a15cd17130da08d32.tar.xz
find-inodes: Sort output
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-xfind-inodes10
1 files changed, 8 insertions, 2 deletions
diff --git a/find-inodes b/find-inodes
index afb5e26..111c64e 100755
--- a/find-inodes
+++ b/find-inodes
@@ -1,3 +1,9 @@
-#!/bin/sh
+#!/bin/bash
GLOBIGNORE=.
-(for i in *; do echo -n "$i: "; find "$i" -xdev | wc -l; done) | sort -nk2
+(
+for i in *; do
+ a=$(find "$i" -xdev | wc -l)
+ printf "%s" "${a%\n}"
+ printf " - %s\n" "$i"
+done
+) | sort -n