SUMMARY (Part 2): How to replace the Bourne shell with the Korn shell

From: Spurgeon, John P (john.p.spurgeon@intel.com)
Date: Tue Nov 11 2003 - 02:27:54 EST


CAVEAT EMPTOR: I've done SOME testing, and so far this does seem to work
- reboots and all. Judge for yourself how backwards compatible you think
the Korn shell really is with the Bourne shell.

- John

Enjoy! (or puke) ...

# df -k

Filesystem kbytes used avail capacity Mounted on
/proc 0 0 0 0% /proc
/dev/dsk/c0d0s0 1588589 537224 1003708 35% /
fd 0 0 0 0% /dev/fd
/dev/dsk/c0d0s5 2896359 575284 2263148 21% /var
/dev/dsk/c0d0s7 127703 1041 113892 1% /export/home
/dev/dsk/c0d0s4 966319 89246 819094 10% /opt
swap 2911940 8 2911932 1% /tmp
/dev/dsk/c0d0s3 5807 1042 4185 20% /shells

# cat /.shells/README

IT'S A SHELL GAME ...

/.shells/
=========
/.shells/README is this file
/.shells/noshell is nice
/.shells/sh was /sbin/sh
/.shells/bsh was /usr/bin/sh
/.shells/ksh was /usr/bin/ksh

When /shells filesystem is NOT mounted:
=======================================
/shells/sh -> /.shells/sh

When /shells filesystem IS mounted:
===================================
/shells/sh -> /.shells/ksh

Other Links:
============
/sbin/sh -> /shells/sh
/sbin/noshell -> /.shells/noshell
/usr/bin/ksh -> /.shells/ksh
/usr/bin/sh -> /.shells/ksh
/usr/bin/rksh -> /.shells/ksh
/usr/lib/rsh -> /.shells/ksh

# cat /etc/profile

if [ -x /opt/logins/bin/disable_interrupts ] \
&& [ -x /opt/logins/bin/enable_interrupts ]
then
    . /opt/logins/bin/disable_interrupts
    case ${LOGNAME:-undefined} in
    undefined)
        print "LOGNAME is undefined!"
        . /opt/logins/bin/enable_interrupts
        sleep 5
        exit 1
        ;;
    someone | special)
        ;;
    *)
        ENVFILE=/etc/.kshrc
        ENV='${ENVFILE[(_$-=1)+(_=0)-(_$-!=_${-%%*i*})]}'
        readonly ENVFILE ENV
        export ENVFILE ENV
        ;;
    esac
    . /opt/logins/bin/enable_interrupts
fi
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:27:27 EDT