diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2020-05-24 16:48:22 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2020-05-25 21:57:14 +0200 |
commit | 31c69b6ca1b91e7fd9fd8e14082fd2584c5f538c (patch) | |
tree | 16e789c7d68608831b498f41f54d9482b82a711a /batch/old/genhex.sh |
first public release
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'batch/old/genhex.sh')
-rwxr-xr-x | batch/old/genhex.sh | 18 |
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 + |