Files
my-scripts/tohex

17 lines
209 B
Plaintext
Raw Normal View History

2026-02-11 10:51:18 +01:00
#!/bin/bash
set -euo pipefail
if [ $# = 1 ]
then
printf "%x\n" "$1"
elif [ $# -gt 1 ]
then
for i in "$@"
do
printf "%d = 0x%X\n" "$i" "$i"
done
else
echo "Usage: $0 <decimal>"
fi