asciibcde20250819ex.sh

#!/bin/bash

# (C) David Vajda
# ASCII BCD Excersize programm
# 2025-08-19
date=$(date | sed 's/[\ \. \:]*//g')
fsol="asciibcd20250819$date.solution.txt"

echo "# (C) David Vajda"
echo "# ASCII BCD Excersize"
echo "# 2025-08-19"
echo "$date"

echo "# (C) David Vajda" >> $fsol
echo "# ASCII BCD Excersize" >> $fsol
echo "# 2025-08-19" >> $fsol
echo "$date" >> $fsol

echo "verwandeln sie folgendende zahlen folge in base64 code"
i=0
while [ $i -lt 48 ]
do
    printf %x $(($RANDOM%256))
    echo -n " "
    i=$(($i+1))
done

echo ""
echo "verwandeln sie folgende zahlen in gepackte und ungepacktes binaeres bcd format"

i=0
while [ $i -lt 48 ]
do
    printf %x $(($RANDOM%10))
    echo -n " "
    i=$(($i+1))
done

echo " "