It's possible to use awk to convert numbers to hex.
This should do the same thing as the sh script:
Code: Select all
echo $1 $2 $3 | awk '{printf "%02X%02X%02X\n",$1,$2,$3}'
Code: Select all
#!/bin/ash
if test $# -eq 0
then
awk '{printf "%02X%02X%02X\n",$1,$2,$3}'
else
echo $1 $2 $3 | awk '{printf "%02X%02X%02X\n",$1,$2,$3}'
fi