Advertisement
metalx1000

Credit Card Swiper

Mar 10th, 2014
14,340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.41 KB | None | 0 0
  1. #!/bin/bash
  2. #created by Kris Occhipinti
  3. #http://filmsbykris.com
  4. #reads and splits data from Credit Card Swiper
  5. #March 10th 2014
  6. :<<'info'
  7.     This program is free software: you can redistribute it and/or modify
  8.     it under the terms of the GNU General Public License as published by
  9.     the Free Software Foundation, either version 3 of the License, or
  10.     (at your option) any later version.
  11.  
  12.     This program is distributed in the hope that it will be useful,
  13.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.     GNU General Public License for more details.
  16.  
  17.     You should have received a copy of the GNU General Public License
  18.     along with this program.  If not, see <http://www.gnu.org/licenses/>.
  19. info
  20.  
  21. clear
  22. echo "Welcome"
  23. while [ 1 ]
  24. do
  25.     echo "Please Swipe Your Card (Enter to Exit):"
  26.     read data
  27.  
  28.     if [ "$data" = "" ]
  29.     then
  30.         echo "Exiting"
  31.         exit 0
  32.     fi
  33.  
  34.     clear
  35.  
  36.     num="$(echo "$data"|cut -d\B -f2|cut -d\^ -f1)"
  37.     name="$(echo "$data"|cut -d\^ -f2)"
  38.     lname="$(echo "$name"|cut -d\/ -f1)"
  39.     fname="$(echo "$name"|cut -d\/ -f2)"
  40.     exdate="$(echo "$data"|cut -d\^ -f3)"
  41.     exdate="${exdate:0:2}/${exdate:2:2}"
  42.  
  43.     echo "Card Number: $num"
  44.     echo "Card Holder: $fname $lname"
  45.     echo "Experation Date: $exdate"
  46.     echo "----------------------------"
  47. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement