Advertisement
Nsfr750

Untitled

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