Analizuoja failo raidžių statistika programa

Referatas
 5
Microsoft Word 28 KB
1 puslapis

#!/bin/bash
DIALOG=${DIALOG=dialog}
declare -a lines
declare -a simboliai
declare -a skaicius
declare -a skirtukai
declare -a skirtuku
E_BADARGS=65
let i=0
let a=0
skirtukai=", "

#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
print ()
{
le=${#simboliai[*]}
sk=0
echo " File: '$FILE' stats"
echo " ~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo
echo
echo
echo "-----------------------"
echo "|SIMBOLIS | DAZNUMAS"
echo "-----------------------"
filename=$OUTFILE
echo "File: '$FILE' stats" > $filename
while [ $sk -lt $le ]
do
echo "|${simboliai[sk]} | ${skaicius[sk]}" >> $filename
echo "|${simboliai[sk]} | ${skaicius[sk]}"
let sk=sk+1
done
echo "-----------------------"
}
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
clear ()
{
let index=0
while [ $index -lt 50 ]
do
echo
let index=index+1
done
}
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
split ()
{
nz=0
splitLength=${#skirtukai}
echo "SKIRTUKAI: $skirtukai"
echo "Skirtuku skaicius: $splitLength"
while [ $nz -lt $splitLength ]
do
skirtuku[nz]=${skirtukai:$nz:1}
echo "$nz ------------- ${skirtuku[nz]}"
let nz=nz+1
done
skirtuku[nz]=""
}
#+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Help ()
{
$DIALOG --title "HELP" --clear...