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

-
Current Location
-

js
  Downloads
    Scripts
      Korn
        Functions
          shcurses



-
 Mt Xia Inc.
-
BOOK:Advanced Shell Scripting



 Join our LinkedIn Group
AIX Advanced Technical Experts
Contract Opportunities

www.LinkedIn.com
-
 Train By Tweet
Training courses Tweet By Tweet
Various Subjects and Products
TrainByTweet.com


AIX Admin Methodology
Global Consolidation Project
All AIX admins should join
www.aixexpert.com
-

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


AIX FREE DEMO UNIX
Automated AIX Deployment
Reduce your DC costs

www.siteox.com

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

initscr



function initscr
{
    PGMNAME="Bourne Shell Curses demo"
    DEV_NULL="/dev/null"
    CMD_TPUT="tput"			# Terminal "put" command

    eval CMD_MOVE=\`echo \"`tput cup`\" \| sed \\\
-e \"s/%p1%d/\\\\\${1}/g\" \\\
-e \"s/%p2%d/\\\\\${2}/g\" \\\
-e \"s/%p1%02d/\\\\\${1}/g\" \\\
-e \"s/%p2%02d/\\\\\${2}/g\" \\\
-e \"s/%p1%03d/\\\\\${1}/g\" \\\
-e \"s/%p2%03d/\\\\\${2}/g\" \\\
-e \"s/%p1%03d/\\\\\${1}/g\" \\\
-e \"s/%d\\\;%dH/\\\\\${1}\\\;\\\\\${2}H/g\" \\\
-e \"s/%p1%c/'\\\\\\\`echo \\\\\\\${1} P | dc\\\\\\\`'/g\" \\\
-e \"s/%p2%c/'\\\\\\\`echo \\\\\\\${2} P | dc\\\\\\\`'/g\" \\\
-e \"s/%p1%\' \'%+%c/'\\\\\\\`echo \\\\\\\${1} 32 + P | dc\\\\\\\`'/g\" \\\
-e \"s/%p2%\' \'%+%c/'\\\\\\\`echo \\\\\\\${2} 32 + P | dc\\\\\\\`'/g\" \\\
-e \"s/%p1%\'@\'%+%c/'\\\\\\\`echo \\\\\\\${1} 100 + P | dc\\\\\\\`'/g\" \\\
-e \"s/%p2%\'@\'%+%c/'\\\\\\\`echo \\\\\\\${2} 100 + P | dc\\\\\\\`'/g\" \\\
-e \"s/%i//g\;s/%n//g\"\`

    CMD_CLEAR="$( ${CMD_TPUT} clear 2>${DEV_NULL} )"	  # Clear display
    CMD_LINES="$( ${CMD_TPUT} lines 2>${DEV_NULL} )"	  # Number of lines on display
    CMD_COLS="$( ${CMD_TPUT} cols 2>${DEV_NULL} )"	  # Number of columns on display
    CMD_CLRTOEOL="$( ${CMD_TPUT} el 2>${DEV_NULL} )"	  # Clear to end of line
    CMD_CLRTOBOL="$( ${CMD_TPUT} el1 2>${DEV_NULL} )"	  # Clear to beginning of line
    CMD_CLRTOEOD="$( ${CMD_TPUT} ed 2>${DEV_NULL} )"	  # Clear to end of display
    CMD_DELCH="$( ${CMD_TPUT} dch1 2>${DEV_NULL} )"	  # Delete current character
    CMD_DELETELN="$( ${CMD_TPUT} dl1 2>${DEV_NULL} )"	  # Delete current line
    CMD_INSCH="$( ${CMD_TPUT} ich1 2>${DEV_NULL} )"	  # Insert 1 character
    CMD_INSERTLN="$( ${CMD_TPUT} il1 2>${DEV_NULL} )"  # Insert 1 Line
    CMD_ATTROFF="$( ${CMD_TPUT} sgr0 2>${DEV_NULL} )"  # All Attributes OFF
    CMD_ATTRSET="${CMD_TPUT}"			  # requires arg ( rev, blink, etc )
    CMD_BEEP="$( ${CMD_TPUT} bel 2>${DEV_NULL} )"	  # ring bell
    CMD_LISTER="cat"
    CMD_SYMLNK="ln -s"
    CMD_ECHO="echo"
    CMD_ECHO="print"
    OPT_ECHO='-n --'
    CMD_MAIL="mail"
    WHOAMI="${LOGNAME}@$( uname -n )"
    WRITER="dfrench@mtxia.com"
    CMD_NOTIFY="\${CMD_ECHO} ${OPT_ECHO} \"\${PGMNAME} - \${WHOAMI} - \$( date )\" | \${CMD_MAIL} \${WRITER}"
    ERROR_PAUSE="sleep 2"
    
    case "_$( uname -s )" in
        "_Windows_NT") ${DEV_NULL}="NUL";
                       CMD_SYMLNK="cp";;
#              "_Linux") CMD_ECHO="echo -e";;
    esac
    
    IFS_CR="$'\n'"
    IFS_CR="
"
    IFS_NORM="$' \t\n'"
    IFS_NORM=" 	
"

    MAC_TIME="TIMESTAMP=\`date +\"%y:%m:%d:%H:%M:%S\"\`"
    MAX_LINES=$( ${CMD_TPUT} lines )
    MAX_COLS=$( ${CMD_TPUT} cols )
    BUF_SCREEN=""
    BUF_TOT=""

    return 0
}
################################################################
function clear
{
    addstr "${CMD_CLEAR}"
    return ${?}
}
################################################################
function refresh
{
    if [[ "_${1}" != "_" ]]
    then
        eval \${CMD_ECHO} ${OPT_ECHO} \"\${${1}}\"
    else
        ${CMD_ECHO} ${OPT_ECHO} "${BUF_SCREEN}"
        BUF_TOT="${BUF_TOT}${BUF_SCREEN}"
        BUF_SCREEN=""
    fi
    return 0
}
################################################################
function move
{
#     chklines "${0}" "${1}" \
#     && chkcols "${0}" "${2}" \
#
################################################################
# HEATH-KIT MOVE COMMAND
#    addstr "Y${1} ${2}"
# VT100 MOVE COMMAND
#    addstr "[${1};${2}H"
# TPUT MOVE COMMAND
    eval addstr \"${CMD_MOVE}\"
# HP TERMINAL MOVE COMMAND
#   addstr "&a${1}y${2}C"
################################################################
#  add your move command below this line

    return ${?}
}

-
initscr
-
 


AIX FREE DEMO UNIX
Automated AIX Deployment
Reduce your DC costs

www.siteox.com

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