Fix bash scripts
This commit is contained in:
@@ -32,7 +32,7 @@ typeset -i MB_SIZE=$1
|
||||
typeset -i RN
|
||||
typeset -i i=1
|
||||
typeset -i X=0
|
||||
WORKDIR=/scripts
|
||||
WORKDIR=./scripts
|
||||
OUTFILE=${WORKDIR}/largefile.random.txt
|
||||
>$OUTFILE
|
||||
THIS_SCRIPT=$(basename $0)
|
||||
@@ -42,7 +42,7 @@ CHAR_FILE=${WORKDIR}/char_file.txt
|
||||
# DEFINE FUNCTIONS HERE
|
||||
##########################################
|
||||
|
||||
build_random_line ()
|
||||
function build_random_line
|
||||
{
|
||||
# This function extracts random characters
|
||||
# from the KEYS array by using the RANDOM
|
||||
@@ -50,7 +50,7 @@ build_random_line ()
|
||||
|
||||
C=1
|
||||
LINE=
|
||||
until (( C > 79 ))
|
||||
until [[ C > 79 ]]
|
||||
do
|
||||
LINE="${LINE}${KEYS[$(($RANDOM % X + 1))]}"
|
||||
(( C = C + 1 ))
|
||||
|
||||
72
chapter2/scripts/char_file.txt
Normal file
72
chapter2/scripts/char_file.txt
Normal file
@@ -0,0 +1,72 @@
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
0
|
||||
q
|
||||
w
|
||||
e
|
||||
r
|
||||
t
|
||||
y
|
||||
u
|
||||
i
|
||||
o
|
||||
p
|
||||
a
|
||||
s
|
||||
d
|
||||
f
|
||||
g
|
||||
h
|
||||
j
|
||||
k
|
||||
l
|
||||
z
|
||||
x
|
||||
c
|
||||
v
|
||||
b
|
||||
n
|
||||
m
|
||||
Q
|
||||
W
|
||||
E
|
||||
R
|
||||
T
|
||||
Y
|
||||
U
|
||||
I
|
||||
O
|
||||
P
|
||||
A
|
||||
S
|
||||
D
|
||||
F
|
||||
G
|
||||
H
|
||||
J
|
||||
K
|
||||
L
|
||||
Z
|
||||
X
|
||||
C
|
||||
V
|
||||
B
|
||||
N
|
||||
M
|
||||
0
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9
|
||||
12800
chapter2/scripts/largefile.random.txt
Normal file
12800
chapter2/scripts/largefile.random.txt
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user