Add scripts for base conversion.

This commit is contained in:
2026-02-11 10:51:18 +01:00
parent 093163ecae
commit 0c5d9525af
2 changed files with 43 additions and 0 deletions

16
tohex Executable file
View File

@@ -0,0 +1,16 @@
#!/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