#!/bin/bash
#
#
#
# Gunblade IV - I was blur when i wrote this.
# http://gunbladeiv.blogspot.com
# Usage:
# sh ./numbers [digits] > hex.lst
# This will create a combination of number depends on the digit you
# entered
#
# visit my blog and make a link in your blog for the credits :)
##########################################################################
echo "Please give the digits for combinations[8-63]: \c"
read digit
echo "Please type the output file name: \c"
read OUTFILE
FINISH=`expr "10^"$digit"" | bc -l`
if [ `echo $digit` -lt 6 ] ;then
export digit = 8
else
break
fi
if [ `echo $digit` -gt 64 ] ;then
export digit = 63
else
break
fi
COUNT="-1"
while [ $COUNT != `expr $FINISH - 1` ] ; do
COUNT=`expr $COUNT + 1`
printf "%+"$digit"s\n" $COUNT | sed s^\ ^0^g >> $OUTFILE
done