Unix Shell - (patch for Bash) 'cardswipe' builtin

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > August 2007 > (patch for Bash) 'cardswipe' builtin





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author (patch for Bash) 'cardswipe' builtin
William Park

2007-08-25, 7:19 pm

Previously, 'readtrack' was command to read track 1 and 2 data from
magnetic card swipe. It's been replaced with 'cardswipe' command which
read/write track data.

cardswipe -[12] array [-c] {-r < file | -w > file}
Read (-r) magnetic card swipe from stdin, and extract track1 and
track2 data. Eg.
track 1: %B...^...?
track 2: ;...=...?
Track segments are returned in shell array variable, specified
by -[12] options for track1 or track2, respectively. Track1 is
always consumed first. Track2 can occur after or before track1,
and is searched in that order. With -c option, returns error if
track is empty or not found.

Inverse of "read". Build card swipe string from track segments,
and write (-w) to stdout. Similiar to
echo -n "%B${track1[*]|,^}?;${track2[*]|,=}?"
With -c option, track will be printed only if it's non-empty.

Ref:
http://home.eol.ca/~parkw/index.html#creditcard

--
William Park <opengeometry@yahoo.ca>, Toronto, Canada
BashDiff: Super Bash shell
http://freshmeat.net/projects/bashdiff/
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com