Skip to content
Snippets Groups Projects
Commit bb2e7070 authored by Rolf Niepraschk's avatar Rolf Niepraschk
Browse files

2. Parameter (Anzahl der Einzelzeichen) ergänzt

parent dd03c8d4
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@
#
# Parameter 1 = Anzahl der erzeugten Bilddateien
#
# Parameter 2 = Anzahl der Einzelzeichen
MAIN="RUSKA7010" # device name
IMAGE_DIR=./images
......@@ -18,6 +19,9 @@ SHOW_EXP=true
if [ -n "$1" ]; then
MAX_FILES=$1
if [ -n "$2" ]; then
NUMBER_OF_DIGITS=$2
fi
fi
rm -rf "$IMAGE_DIR"
......@@ -75,9 +79,13 @@ for ((FNb=1; FNb<=MAX_FILES; FNb++)); do
value=""
for (( i=1; i<=$MAX_DIGITS; i++ )); do
R=$((RANDOM % 15)) # random digit number (0..14='0'..'a')
eval CHAR$i=${charFile[R]}
value+="${NUM2CHAR[R]}"
if (( $i <= $NUMBER_OF_DIGITS )); then
R=$((RANDOM % 15)) # random digit number (0..14='0'..'a')
eval CHAR$i=${charFile[R]}
value+="${NUM2CHAR[R]}"
else
eval CHAR$i=$emptyCanvas;
fi
done # NUMBER_OF_DIGITS
fname="$IMAGE_DIR/$MAIN@$value@.png"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment