-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcreate_regex.sh
42 lines (39 loc) · 2 KB
/
create_regex.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
while read line; do
line=`echo $line | tr -d ','`
NEWSTRING=""
for (( i=0; i<${#line}; i++ )); do
CURRENTCHAR="${line:$i:1}"
case $CURRENTCHAR in
a|A) NEWSTRING="$NEWSTRING[aA4@]" ;;
b|B) NEWSTRING="$NEWSTRING[bB8]" ;;
c|C) NEWSTRING="$NEWSTRING[cC(]" ;;
d|D) NEWSTRING="$NEWSTRING[dD)]" ;;
e|E) NEWSTRING="$NEWSTRING[eE3]" ;;
f|F) NEWSTRING="$NEWSTRING[fF]" ;;
g|G) NEWSTRING="$NEWSTRING[gG69]" ;;
h|H) NEWSTRING="$NEWSTRING[hH#]" ;;
i|I) NEWSTRING="$NEWSTRING[iI1!|]" ;;
j|J) NEWSTRING="$NEWSTRING[jJi]" ;;
k|K) NEWSTRING="$NEWSTRING[kK<]" ;;
l|L) NEWSTRING="$NEWSTRING[lL1!]" ;;
m|M) NEWSTRING="$NEWSTRING[mM]" ;;
n|N) NEWSTRING="$NEWSTRING[nN]" ;;
o|O) NEWSTRING="$NEWSTRING[oO0]" ;;
p|P) NEWSTRING="$NEWSTRING[pP]" ;;
q|Q) NEWSTRING="$NEWSTRING[qQ]" ;;
r|R) NEWSTRING="$NEWSTRING[rR]" ;;
s|S) NEWSTRING="$NEWSTRING[sS\$5]" ;;
t|T) NEWSTRING="$NEWSTRING[tT+7]" ;;
u|U) NEWSTRING="$NEWSTRING[uU]" ;;
v|V) NEWSTRING="$NEWSTRING[vV]" ;;
w|W) NEWSTRING="$NEWSTRING[wW]" ;;
x|X) NEWSTRING="$NEWSTRING[xX]" ;;
y|Y) NEWSTRING="$NEWSTRING[yY]" ;;
z|Z) NEWSTRING="$NEWSTRING[zZ2]" ;;
*) NEWSTRING="$NEWSTRING[$CURRENTCHAR]" ;;
esac
done
# echo "$line,$NEWSTRING"
echo "$NEWSTRING" | tee -a "$2/$line.grep"
done < $1