Advertisement
metalx1000

Driver's License Reader

Mar 11th, 2014
668
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.02 KB | None | 0 0
  1. #!/bin/bash
  2. #created by Kris Occhipinti
  3. #http://filmsbykris.com
  4. #reads and splits data from Driver's Licenes Swiper
  5. #March 11th 2014
  6. #more info on DL data: http://dcm.uhcl.edu/caps7g8/Drivers%20License.pdf
  7. :<<'info'
  8.     This program is free software: you can redistribute it and/or modify
  9.     it under the terms of the GNU General Public License as published by
  10.     the Free Software Foundation, either version 3 of the License, or
  11.     (at your option) any later version.
  12.  
  13.     This program is distributed in the hope that it will be useful,
  14.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.     GNU General Public License for more details.
  17.  
  18.     You should have received a copy of the GNU General Public License
  19.     along with this program.  If not, see <http://www.gnu.org/licenses/>.
  20. info
  21.  
  22. clear
  23. echo "Welcome"
  24. while [ 1 ]
  25. do
  26.     echo "Please Swipe Your Card (Enter to Exit):"
  27.     read data
  28.  
  29.     if [ "$data" = "" ]
  30.     then
  31.         echo "Exiting"
  32.         exit 0
  33.     fi
  34.  
  35.     clear
  36.  
  37.     num="$(echo "$data"|sed 's/63601015//g'|cut -d\; -f2|cut -d\= -f1)"
  38.     name="$(echo "$data"|cut -d\^ -f2)"
  39.     lname="$(echo "$name"|cut -d\$ -f1)"
  40.     fname="$(echo "$name"|cut -d\$ -f2)"
  41.     mname="$(echo "$name"|cut -d\$ -f3)"
  42.     address="$(echo "$data"|cut -d\^ -f3|cut -d\? -f1)"
  43.     zip="$(echo "$data"|cut -d\! -f2|awk '{print $1}')"
  44.     sc="$(echo "$data"|cut -d\% -f2|cut -d\^ -f1)"
  45.     state="${sc:0:2}"
  46.     city="${sc:2:10}"
  47.  
  48.     dob="$(echo "$data"|cut -d\= -f2)"
  49.     doby="${dob:4:4}"
  50.     let dobm="${dob:9:1}"
  51.     let dobm+=1
  52.     dobd="${dob:10:2}"
  53.    
  54.     exdate="$(echo "$data"|cut -d\= -f2)"
  55.     exdate="${exdate:2:2}/${exdate:0:2}"
  56.  
  57.     echo "Driver's License Number: $num"
  58.     echo "Card Holder: $fname $mname $lname"
  59.     echo "DOB: $doby-$dobm-$dobd"
  60.  
  61.     echo "Address: "
  62.     echo "$address"
  63.     echo "$city, $state $zip"
  64.  
  65.     echo "Experation Date: $exdate"
  66.     echo "----------------------------"
  67. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement