summaryrefslogtreecommitdiff
path: root/scripts/bin_size
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/bin_size')
-rw-r--r--scripts/bin_size10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/bin_size b/scripts/bin_size
new file mode 100644
index 0000000..43e1b36
--- /dev/null
+++ b/scripts/bin_size
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+if [ $# = 0 ] ; then
+ echo Usage: $0 file
+fi
+
+size_dec=`stat -c "%s" $1`
+size_hex_echo_string=`printf "%08x" $size_dec |
+ sed 's/\(..\)\(..\)\(..\)\(..\)/\\\\x\4\\\\x\3\\\\x\2\\\\x\1/g'`
+/bin/echo -ne $size_hex_echo_string