Home About BC DR HA Support Training Download
You are here: Home/ Downloads/ Scripts/ Korn/ Functions/ Please Login or Register

-
Current Location
-

js
  Downloads
    Scripts
      Korn
        Functions
-
AIX Admin Methodology
Global Consolidation Project
All AIX admins should join
www.aixexpert.com


Join our LinkedIn Group
AIX Advanced Technical Experts
Contract Opportunities

www.LinkedIn.com

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


LPAR Leasing
Lease an AIX / i5 LPAR
Reduce your costs

www.mtxia.com

Server Leasing
Lease a Server off-site
Reduce your costs

www.mtxia.com

Data Center Automation
Business Continuity and DR
Virtualization/Consolidation

www.mtxia.com

HMC Service
Hardware Management Console
Manage Remote AIX / i5 LPARs

www.siteox.com

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

www.siteox.com

Disaster Recovery
Small Business Oriented
Off-Site Facilities

www.mtxia.com

IBM pSeries / iSeries
Reduce your Costs
Off-Site Server Hosting

www.mtxia.com

cgiparse

Korn Shell 93 function to parse CGI variables containing encoded HEX characters.




################################################################
####
#### Program: cgiparse
#### 
#### Description: Korn Shell 93 function to parse CGI variables 
#### containing encoded HEX characters.  Initializes CGI 
#### variables with their assigned values into the current
#### shell environment.  If no CGI variable is passed, then
#### the parsed CGI string is sent to standard output.
####
#### Description:	Version 0.2	
####
#### Author:	Dana French (dfrench@mtxia.com)
####		615.556.0456
####
#### Date:		20061024
####
#### Usage: 
#### 
####   IFS="&" PARSED=( ${QUERY_STRING} )
####   for VAR in "${PARSED[@]}"
####   do
####     print "${VAR}" | cgiparse
####   done
####
################################################################
function cgiparse_k93
{
  typeset CGILINE
  typeset CGITMP
  typeset CGIVAR
  typeset CGIVAL
  CGIIFS="${IFS}"
  IFS=''
  while read -r -- CGILINE
  do
    CGITMP="${CGILINE//+/ }"
    CGITMP="${CGITMP//%([A-Za-z0-9][A-Za-z0-9])/\$( printf "'\\\0%o'" 0x\1 )}"
    CGIVAR="${CGITMP%%=*}"
    CGIVAL="${CGITMP#*=}"
    CGITMP="${CGIVAR}=\"\\\"${CGIVAL}\\\"\""
    [[ "${CGITMP}" = *=* ]] &&
      eval $( eval print -- "${CGITMP}" ) ||
      eval print -- "${CGITMP}"
  done
  IFS="${CGIIFS}"
}
################################################################

-
CGI Parser
-
 


LPAR Leasing
Lease an AIX / i5 LPAR
Reduce your costs

www.mtxia.com

Server Leasing
Lease a Server off-site
Reduce your costs

www.mtxia.com

Data Center Automation
Business Continuity and DR
Virtualization/Consolidation

www.mtxia.com

HMC Service
Hardware Management Console
Manage Remote AIX / i5 LPARs

www.siteox.com

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

Disaster Recovery
Small Business Oriented
Off-Site Facilities

www.mtxia.com

IBM pSeries / iSeries
Reduce your Costs
Off-Site Server Hosting

www.mtxia.com