-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdecode
executable file
·108 lines (69 loc) · 3.58 KB
/
decode
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#!/bin/bash
GM=~/Decoder/GM.txt
HONDA=~/Decoder/HONDA.txt
MAKEMODEL=~/Decoder/MAKE-MODEL.txt
country=~/Decoder/country.txt
year=~/Decoder/year.txt
location=~/Decoder/list.txt
Honda() #WORKING
{
mdleng=$(echo "$four$five$six")
MODELandENGINE=$(grep -i "$mdleng :" $MAKEMODEL | cut -d ":" -f2 | cut -d "/" -f1 )
HONDAENGINE=$(grep -i "$mdleng :" $MAKEMODEL | cut -d ":" -f2 | cut -d "/" -f2)
PLANT=$(grep -i PLANT$eleven $MAKEMODEL | cut -d ":" -f2)
SEQUENCE=$(echo "$twelve$thirteen$fourteen$fifteen$sixteen$seventeen")
equtrimlvl=$(echo "$four$five$six$eight")
EQUIPTMENTTRIMLEVEL=$(grep "$equtrimlvl :" $HONDA | cut -d ":" -f2)
YEAR=$(grep "$ten " $year | cut -d ":" -f2)
COUNTRY=$(grep "$one :" $country | cut -d ":" -f2)
LOADNUMBER=$(grep -i "$filename" ~/Vin_search/M6648241/text/* | cut -d '/' -f7 | cut -d "." -f1)
echo -e "\n\nVIN: $filename\nCOUNTRY OF ORIGIN: $COUNTRY\nYEAR: $YEAR\nMANUFACTURER: $MFRandTYPE\nMODEL: $MODELandENGINE\nTRIM: $EQUIPTMENTTRIMLEVEL\nENGINE: $HONDAENGINE\nPLANT: $PLANT\nSEQUENCE: $SEQUENCE\n\n"
unset mdleng MODELandENGINE PLANT SEQUENCE equtrimlvl EQUIPTMENTTRIMLEVEL YEAR COUNTRY LOADNUMBER HONDAENGINE
return 0
}
GM() #NOT WORKING - PLANT
{
mdleng=$(echo "$four$five$six")
MODELandENGINE=$(grep -i "$mdleng :" $GM | cut -d ":" -f2 | cut -d "/" -f1 )
MODEL=$(grep -i "$mdleng :" $GM | cut -d ":" -f2 | cut -d "/" -f1 | cut -d " " -f2)
ENGINE=$(grep -i "<${MODEL}ENGINE${eight}>" $GM | cut -d ">" -f2)
#PLANT=$(grep -i PLANT$eleven $HONDAcar | cut -d ":" -f2)
SEQUENCE=$(echo "$twelve$thirteen$fourteen$fifteen$sixteen$seventeen")
EQUIPTMENTTRIMLEVEL=$(grep -i "$mdleng :" $GM | cut -d ':' -f2 | cut -d '/' -f2 )
YEAR=$(grep "$ten " $year | cut -d ":" -f2)
COUNTRY=$(grep "$one :" $country | cut -d ":" -f2)
echo -e "\n\nVIN: $filename\nCOUNTRY OF ORIGIN: $COUNTRY\nYEAR: $YEAR\nMANUFACTURER: $MFRandTYPE\nMODEL: $MODELandENGINE\nTRIM: $EQUIPTMENTTRIMLEVEL\nENGINE: $ENGINE\nPLANT: $PLANT\nSEQUENCE: $SEQUENCE\n\n"
unset mdleng MODELandENGINE PLANT SEQUENCE equtrimlvl EQUIPTMENTTRIMLEVEL YEAR COUNTRY LOADNUMBER MODEL ENGINE filename
}
Hyundai()
{
echo "Hyundai NOT IN DATABASE YET"
}
GMC()
{
echo "GMC NOT IN DATABASE YET"
}
one=$(echo "$1" | cut -b 1)
two=$(echo "$1" | cut -b 2)
three=$(echo "$1" | cut -b 3)
four=$(echo "$1" | cut -b 4)
five=$(echo "$1" | cut -b 5)
six=$(echo "$1" | cut -b 6)
seven=$(echo "$1" | cut -b 7)
eight=$(echo "$1" | cut -b 8)
nine=$(echo "$1" | cut -b 9)
ten=$(echo "$1" | cut -b 10)
eleven=$(echo "$1" | cut -b 11)
twelve=$(echo "$1" | cut -b 12)
thirteen=$(echo "$1" | cut -b 13)
fourteen=$(echo "$1" | cut -b 14)
fifteen=$(echo "$1" | cut -b 15)
sixteen=$(echo "$1" | cut -b 16)
seventeen=$(echo "$1" | cut -b 17)
filename=$(echo "$one$two$three$four$five$six$seven$eight$nine$ten$eleven$twelve$thirteen$fourteen$fifteen$sixteen$seventeen") # filename saved as VIN
mfrtype=$(echo "$one$two$three")
MFRandTYPE=$(grep -i "$mfrtype :" $MAKEMODEL | cut -d ":" -f2)
MAKE1=$(echo "$MFRandTYPE" | cut -d " " -f1)
MAKE=$(grep -i "$MAKE1 :" $MAKEMODEL | cut -d ':' -f2)
$MAKE
unset MAKE1 MAKE