#!/bin/bash

SIGN_DIR="georf_signs/"
SIGN_BEGIN="sign_georf"
SIGN_FILE="signatur_georf"

cd `dirname $0`

declare -a files

i=0
for file in "$SIGN_DIR"*
do
	files[$i]="$file"
	i=`expr $i + 1`
done

# create an array of the files.
files=("$SIGN_DIR"*)


# number of members in the array
N=${#files[@]}            
((N=$RANDOM%$N))
randomfile=${files[$N]}

# generate sign
cat "$SIGN_BEGIN" > "$SIGN_FILE"
cat "$randomfile" >> "$SIGN_FILE"
