Mt Xia: Technical Consulting Group

Business Continuity / Disaster Recovery / High Availability
Data Center Automation / Audit Response / Audit Compliance

-
Current Location
-

css
  Downloads
    Scripts
      Korn

-

digg Digg this page
del.icio.us Post to del.icio.us
Slashdot Slashdot it!


Business Web Site Hosting
$3.99 / month includes Tools,
Shopping Cart, Site Builder

www.siteox.com

FREE Domain Registration
included with Web Site Hosting
Tools, Social Networking, Blog

www.siteox.com

mkord

- Generate an ASCII Table into an array (indexed by ASCII Decimal Value)




################################################################
#### 
#### This function accepts an associative array variable name
#### as the first command line argument, and builds an ASCII
#### table of characters in that array.  Array index is 
#### the decimal, hex, or octal number associated with the 
#### character.  Value is the ASCII character.
#### 
################################################################
function mkord
{
  typeset IDX='${CNT}'
  [[ "_${2}" != "_" && "_${2}" =  "_8" ]] && IDX='$( printf "%o" 0x${i}${j} )'
  [[ "_${2}" != "_" && "_${2}" = "_16" ]] && IDX='${i}${j}'
  nameref ORD_TABLE=$1
  typeset CNT=0
  for i in 0 1 2 3 4 5 6 7 8 9 A B C D E F
  do
    for j in 0 1 2 3 4 5 6 7 8 9 A B C D E F
    do
      eval ORD_TABLE[${IDX}]=$(print -- $( printf "\\\0%o" 0x${i}${j} ) )
      (( CNT = CNT + 1 ))
    done
  done
}

-
ASCII Table
-
 


FREE Domain Registration
included with Web Site Hosting
Tools, Social Networking, Blog

www.siteox.com

Business Web Site Hosting
$3.99 / month includes Tools,
Shopping Cart, Site Builder

www.siteox.com