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

-
Current Location
-

js
  Downloads
    Scripts
      Korn
        K93_Unix
-
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



#!/usr/bin/ksh93
################################################################
#### Program: tee_k93
#### 
#### Description: Emulation of the Unix "tee" command
#### 
#### Author: Dana French (dfrench@mtxia.com)
####         Copyright 2004
#### 
#### Date: 07/28/2004
#### 
################################################################
function tee_k93 {
  typeset TRUE="0"
  typeset FALSE="1"
  typeset VERBOSE="${FALSE}"
  typeset VERYVERB="${FALSE}"
  typeset APPEND="${FALSE}"
  typeset FNAME

  while getopts ":avV" OPTION
  do
    case "${OPTION}" in
        'a') APPEND="${TRUE}";;
        'v') VERBOSE="${TRUE}";;
        'V') VERYVERB="${TRUE}";;
        '?') print "Syntax: tee_k93 [FILE]..." && exit 1 ;;
    esac
  done
 
    shift $(( ${OPTIND} - 1 ))

    FNAME="${1}"
    if [[ "_${FNAME}" = "_" ]]
    then
        print -u 2 "ERROR: output file name not specified"
        return 1
    fi
    if (( APPEND == TRUE ))
    then
        if ! exec 3>>"${FNAME}"
        then
            print -u 2 "ERROR: Unable to append to file ${FNAME}"
            return 2
        fi
    else
        if ! exec 3>"${FNAME}"
        then
            print -u 2 "ERROR: Unable to write to file ${FNAME}"
            return 3
        fi
    fi

    while IFS="" read -r -- LINE
    do
        print -u 3 -r -- "${LINE}"
        print -r -- "${LINE}"
    done

    exec 3>&-

  return "${TRUE}"
}
################################################################

tee_k93 "${@}"

-
tee_k93
-
 


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