aboutsummaryrefslogtreecommitdiff
path: root/batch/old/genhex.sh
diff options
context:
space:
mode:
Diffstat (limited to 'batch/old/genhex.sh')
-rwxr-xr-xbatch/old/genhex.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/batch/old/genhex.sh b/batch/old/genhex.sh
new file mode 100755
index 0000000..114ea34
--- /dev/null
+++ b/batch/old/genhex.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+if [ -z "$1" ]; then
+ DPATH="$(pwd)"
+else
+ DPATH="$1"
+fi
+
+echo "$0: generate *.hex files in $(ls ${DPATH})"
+for file in $(ls ${DPATH}); do
+ [ -d ${file} ] && continue
+ FLEN=$((${#file}-4))
+ FSUFFIX=${file:$FLEN:4}
+ if [ "$FSUFFIX" != ".hex" ]; then
+ xxd "${file}" > "${file}.hex"
+ fi
+done
+