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

getch

Korn Shell getch: Capture a single key press without requiring carriage return or enter key.



################################################################
####    Korn Shell function to read one character from
####    standard input (STDIN) without requiring a carriage
####    return.  This function would typically be used in a
####    shell script to detect a key press.
####
####    Load this file into your current environment as follows:
####
####    . ./getch
####
####    Thats "dot-space-dot-slash-getch-dot-sh"
####
####    You will then be able to issue the command "getch"
####    from your current environment to retrieve one character.
####
####    SYNTAX: getch [-q]
####
####                   -q = quiet mode, no output
####
####    AUTHOR: Dana French (dfrench@mtxia.com)
####
################################################################
function getch {
    typeset TMP_GETCH
    typeset STAT_GETCH="0"
    stty raw
    TMP_GETCH=`dd bs=1 count=1 2> /dev/null`
    STAT_GETCH="${?}"
    stty -raw

    if [[ "_${1}" != "_-q" ]]
    then
        print -r -- "${TMP_GETCH}"
    fi
    return ${STAT_GETCH}
}

-
Get a single Char
-
 


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