openocd/src/helper/bin2char.sh
Antonio Borneo aa628304e2 helper: fix minor typos
Change-Id: I785e388148c0329e51cb0b39ab30e8ee44f5a7cd
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5801
Tested-by: jenkins
2020-09-05 17:10:54 +01:00

15 lines
447 B
Bash
Executable File

#!/bin/sh
[ $# != 0 ] && {
echo "Usage: $0"
echo
echo "Read binary data from standard input and write it as a comma separated"
echo "list of hexadecimal byte values to standard output. The output is usable"
echo "as a C array initializer. It is terminated with a comma so it can be"
echo "continued e.g. for zero termination."
exit 1
}
echo "/* Autogenerated with $0 */"
od -v -A n -t x1 | sed 's/ *\(..\) */0x\1,/g'