From: kraemerf@franvm3.VNET.IBM.COM (Frank Kraemer)
Date: Fri, 18 Dec 92 10:25:03 CET
Newsgroups: comp.unix.aix
Subject: Re. AIX .profile & .kshrc
Reply-To: kraemerf@franvm3.VNET.IBM.COM
Organization: IBM Germany, BO-89 ACIS South
Disclaimer: This posting represents the poster's views, not those of IBM
News-Software: Usenet 3.0

.

willis@evax0.eng.fsu.edu writes:
>   I'm having trouble getting aliases to work within my .profile file on
>   my RS/6000 AIX machine.  I've included a copy of my .profile file

    <staff deleted>

I'm using 2 files $HOME/.profile and $HOME/.kshrc:

#!/bin/ksh
# @(#) Just a nice $HOME/.profile
#-------------------------------------------------------------------#
#  File   : $HOME/.profile                                          #
#  Date     : 90/09/29  (yy/mm/dd)                                  #
#  Update   : 92/04/22  (yy/mm/dd)                                  #
#  Author   : F. Kraemer                                            #
#-------------------------------------------------------------------#
#  The following statements are used to expand                      #
#         START[0] - interactive mode - ${i} is set to 'i'          #
#         START[1] - non interactive   - ${i} is set to ' '         #
#-------------------------------------------------------------------#
START=$HOME/.kshrc
ENV='${START[(_$-=1)+(_=0)-(_$-!=_${-%%*i*})]}'; export ENV
#-------------------------------------------------------------------#
# The PATH variable.                                                #
#-------------------------------------------------------------------#
PATH=/bin:/usr/bin:/usr/sbin:/etc:/usr/ucb:$HOME/bin:/usr/bin/X11:.
#-------------------------------------------------------------------#
# The LANG and NLSPATH variables. (Important for the C-Compiler.)   #
#-------------------------------------------------------------------#
LANG=En_US
NLSPATH=/usr/lpp/msg/%L/%N:/usr/lpp/msg/En_US/%N
#-------------------------------------------------------------------#
# The epath variable for e3 - editor support.                       #
#-------------------------------------------------------------------#
export epath="/usr/sbin/bin"
#-------------------------------------------------------------------#
# The VEPATH variable for ve - editor support.                      #
#-------------------------------------------------------------------#
export VEPATH="/usr/sbin/bin"
#-------------------------------------------------------------------#
# AIX Interface Composer definitions.                               #
#-------------------------------------------------------------------#
export AICDIR="/usr/lpp/aic"
PATH=${PATH}:${AICDIR}/bin
#-------------------------------------------------------------------#
# Make the variables known in the environment.                      #
#-------------------------------------------------------------------#
export HOME MAIL PATH TERM PS1 PS2 LANG NLSPATH VISUAL
#-------------------------------------------------------------------#
# Where are the postmen ?                                           #
#-------------------------------------------------------------------#
if [ -s "$MAIL" ]           # This is at Shell startup.  In normal
    then echo "$MAILMSG"    # operation, the Shell checks
fi                          # periodically.
#-------------------------------------------------------------------#
# Customize your screen.                                            #
#-------------------------------------------------------------------#
chcolor -b 5 -f 16
#-------------------------------------------------------------------#
# Execute after every login.                                        #
#-------------------------------------------------------------------#
rm -f .sh_history > /dev/null 2>&1
rm -f .ve_history > /dev/null 2>&1
rm -f smit.log    > /dev/null 2>&1
rm -f smit.script > /dev/null 2>&1
cat /etc/motd
sleep 2
tput clear
df
#-------------------------------------------------------------------#
# Execute after every login.                                        #
#-------------------------------------------------------------------#
 TERMTYPE=$(tty | grep hft)
 if [ -n "$TERMTYPE" -o -n "$XSTATION" ]
  then
         if [ "$TERM" = "hft" ]
          then
           chhwkbd -d 250
           chhwkbd -r 30
#          open ksh
         fi
         if [ -f /usr/lpp/X11/bin/xinit ]
            then
              if [ "$TERM" = "hft" ]
                then
                    echo ".....start X11 with xinit -bs !"
#                   /usr/lpp/X11/bin/xinit -bs
                else
                  if [ "$DISPLAY" = "xst1:0" ]
                    then
                       echo "AIX-Windows started with backing store option .
.."
                       /usr/lpp/X11/bin/xinit -bs
                    else
                      /usr/lpp/X11/bin/xinit
                  fi
              fi
          fi
 fi
#-------------------------------------------------------------------#
# This is the end of the .profile                                   #
#-------------------------------------------------------------------#

#!/bin/ksh
# @(#) Just a nice $HOME/.kshrc
#-------------------------------------------------------------------#
#  File   : $HOME/.kshrc                                            #
#                                                                   #
#  Date     : 90/09/29  (yy/mm/dd)                                  #
#  Update   : 92/04/23  (yy/mm/dd)                                  #
#  Author   : F. Kraemer                                            #
#  Abstract : ksh ENV file which is called from                     #
#             $HOME/.profile if invocted in interactive mode        #
#-------------------------------------------------------------------#
#  Use vi command line editing                                      #
#-------------------------------------------------------------------#
# set -o vi
# typeset -x FCEDIT=vi
#-------------------------------------------------------------------#
#  Use emacs command line editing                                   #
#-------------------------------------------------------------------#
set -o emacs
typeset -x FCEDIT=/bin/ed
typeset -x VISUAL=emacs
typeset -x EDITOR=/bin/ed
typeset -x CDPATH=:
typeset -x E3_FILE="${HOME}/.noname"
#-------------------------------------------------------------------#
#  Use 'exit' to quit from login shell and do not log functions     #
#-------------------------------------------------------------------#
set -o ignoreeof
set -o nolog
#-------------------------------------------------------------------#
#  create a different history file for each "window"                #
#-------------------------------------------------------------------#
ttyname=$(tty)
HISTFILE=${HOME}/.sh_history
HISTSIZE=128
#-------------------------------------------------------------------#
#  alias definitions                                                #
#-------------------------------------------------------------------#
# alias rn="rn -e -L -M"
# alias source="."
#-------------------------------------------------------------------#
#  directory aliases                                                #
#-------------------------------------------------------------------#
alias -x dir="/bin/ls -la"
alias -x la="/bin/ls -CFa"
alias -x ll="/bin/ls -la"
alias -x lt="/bin/li -vSm"
alias -x cd..="cd .."
alias -x o="open ksh"
#-------------------------------------------------------------------#
#  Screen management commands                                       #
#-------------------------------------------------------------------#
alias -x cls="tput clear"
#-------------------------------------------------------------------#
#  Fancy pg command                                                 #
#-------------------------------------------------------------------#
alias -x pg="pg -cnsp[%d]"
#-------------------------------------------------------------------#
#  System management commands                                       #
#-------------------------------------------------------------------#
alias -x halt="/usr/sbin/shutdown -F"
#-------------------------------------------------------------------#
#  Print commands                                                   #
#-------------------------------------------------------------------#
# alias lp=/bin/print
# alias qp="/bin/print -q"
# alias can="/bin/print -ca"
# alias -x kprint=print;
# alias -x print=/bin/print;
#-------------------------------------------------------------------#
#  Program development commands                                     #
#-------------------------------------------------------------------#
# alias tout="tail nohup.out"
# alias nake="nohup nice lm LIST=LIST &"
# alias vl="EDITOR=vi $KUB/vl"
#-------------------------------------------------------------------#
#  Status commands for this terminal/user                           #
#-------------------------------------------------------------------#
# alias pst="ps -t $TTYNAME"
# alias psu="ps -u $LOGNAME"
# alias psf="ps -ef | fgrep"
#-------------------------------------------------------------------#
#  build prompt                                                     #
#-------------------------------------------------------------------#
myid=$(id | sed -n -e 's/).*$//' -e 's/^.*(//p')
if [ ${myid} = root ]
then    typeset -x PSCH='#'
else    typeset -x PSCH='$'
fi
#-------------------------------------------------------------------#
# Make sure some environment variables are set for TTYNAME and HOST #
#-------------------------------------------------------------------#
typeset -x TTYNAME=$(tty | sed "s/^\/dev\///")
if [ -z "$HOST" ]
then    typeset -x HOST=$(hostname)
fi
#-------------------------------------------------------------------#
#  Use color just on hft                                            #
#-------------------------------------------------------------------#
if [ "$TERM" = "emacs" ] \
        || [ `echo $TTYNAME|sed -n -e 's/^tty/tty/p'` ]
then
       typeset -x PSPF="$myid@$HOST:"
else
       typeset -x PSPF="[32m$myid[33m@[31m$HOST:[33m"
fi
#-------------------------------------------------------------------#
# Nice prompt.                                                      #
#-------------------------------------------------------------------#
if [ "$TERM" = "emacs" ] \
        || [ `echo $TTYNAME|sed -n -e 's/^tty/tty/p'` ]\
        || [ `echo $TTYNAME|sed -n -e 's/^pts/pts/p'` ]
then
        typeset PS1='${PSPF}${PWD}>'
else
        typeset PS1='${PSPF}${PWD}> '
fi
#-------------------------------------------------------------------#
#  EOF                                                              #
#-------------------------------------------------------------------#








.----------------------------------------------------------------------.
| E-Mail: FRANVM3(KRAEMERF)                 - IBM VNET  "Yes, I'm one  |
| ======  IBMMAIL(DEIBM27S)                 - IBM-Mail   of those      |
|         DE.IBMX400.IBMMAIL.KRAEMER.KRAEME - X.400      stupid IBM    |
|         kraemerf@franvm3.vnet.ibm.com     - Internet   field SE's."  |
| Voice : +49-(0)611/776-364                                           |
| Mail  : Abraham-Lincoln Street 26, 6200 Wiesbaden, Germany           |
'----------------------------------------------------------------------'
Newsgroups: comp.unix.aix