home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / unix / aix / 12677 < prev    next >
Encoding:
Internet Message Format  |  1992-12-20  |  11.3 KB

  1. Path: sparky!uunet!franvm3.VNET.IBM.COM
  2. From: kraemerf@franvm3.VNET.IBM.COM (Frank Kraemer)
  3. Message-ID: <19921218.012604.869@almaden.ibm.com>
  4. Date: Fri, 18 Dec 92 10:25:03 CET
  5. Newsgroups: comp.unix.aix
  6. Subject: Re. AIX .profile & .kshrc
  7. Reply-To: kraemerf@franvm3.VNET.IBM.COM
  8. Organization: IBM Germany, BO-89 ACIS South
  9. Disclaimer: This posting represents the poster's views, not those of IBM
  10. News-Software: Usenet 3.0
  11. Lines: 241
  12.  
  13. .
  14.  
  15. willis@evax0.eng.fsu.edu writes:
  16. >   I'm having trouble getting aliases to work within my .profile file on
  17. >   my RS/6000 AIX machine.  I've included a copy of my .profile file
  18.  
  19.     <staff deleted>
  20.  
  21. I'm using 2 files $HOME/.profile and $HOME/.kshrc:
  22.  
  23. #!/bin/ksh
  24. # @(#) Just a nice $HOME/.profile
  25. #-------------------------------------------------------------------#
  26. #  File   : $HOME/.profile                                          #
  27. #  Date     : 90/09/29  (yy/mm/dd)                                  #
  28. #  Update   : 92/04/22  (yy/mm/dd)                                  #
  29. #  Author   : F. Kraemer                                            #
  30. #-------------------------------------------------------------------#
  31. #  The following statements are used to expand                      #
  32. #         START[0] - interactive mode - ${i} is set to 'i'          #
  33. #         START[1] - non interactive   - ${i} is set to ' '         #
  34. #-------------------------------------------------------------------#
  35. START=$HOME/.kshrc
  36. ENV='${START[(_$-=1)+(_=0)-(_$-!=_${-%%*i*})]}'; export ENV
  37. #-------------------------------------------------------------------#
  38. # The PATH variable.                                                #
  39. #-------------------------------------------------------------------#
  40. PATH=/bin:/usr/bin:/usr/sbin:/etc:/usr/ucb:$HOME/bin:/usr/bin/X11:.
  41. #-------------------------------------------------------------------#
  42. # The LANG and NLSPATH variables. (Important for the C-Compiler.)   #
  43. #-------------------------------------------------------------------#
  44. LANG=En_US
  45. NLSPATH=/usr/lpp/msg/%L/%N:/usr/lpp/msg/En_US/%N
  46. #-------------------------------------------------------------------#
  47. # The epath variable for e3 - editor support.                       #
  48. #-------------------------------------------------------------------#
  49. export epath="/usr/sbin/bin"
  50. #-------------------------------------------------------------------#
  51. # The VEPATH variable for ve - editor support.                      #
  52. #-------------------------------------------------------------------#
  53. export VEPATH="/usr/sbin/bin"
  54. #-------------------------------------------------------------------#
  55. # AIX Interface Composer definitions.                               #
  56. #-------------------------------------------------------------------#
  57. export AICDIR="/usr/lpp/aic"
  58. PATH=${PATH}:${AICDIR}/bin
  59. #-------------------------------------------------------------------#
  60. # Make the variables known in the environment.                      #
  61. #-------------------------------------------------------------------#
  62. export HOME MAIL PATH TERM PS1 PS2 LANG NLSPATH VISUAL
  63. #-------------------------------------------------------------------#
  64. # Where are the postmen ?                                           #
  65. #-------------------------------------------------------------------#
  66. if [ -s "$MAIL" ]           # This is at Shell startup.  In normal
  67.     then echo "$MAILMSG"    # operation, the Shell checks
  68. fi                          # periodically.
  69. #-------------------------------------------------------------------#
  70. # Customize your screen.                                            #
  71. #-------------------------------------------------------------------#
  72. chcolor -b 5 -f 16
  73. #-------------------------------------------------------------------#
  74. # Execute after every login.                                        #
  75. #-------------------------------------------------------------------#
  76. rm -f .sh_history > /dev/null 2>&1
  77. rm -f .ve_history > /dev/null 2>&1
  78. rm -f smit.log    > /dev/null 2>&1
  79. rm -f smit.script > /dev/null 2>&1
  80. cat /etc/motd
  81. sleep 2
  82. tput clear
  83. df
  84. #-------------------------------------------------------------------#
  85. # Execute after every login.                                        #
  86. #-------------------------------------------------------------------#
  87.  TERMTYPE=$(tty | grep hft)
  88.  if [ -n "$TERMTYPE" -o -n "$XSTATION" ]
  89.   then
  90.          if [ "$TERM" = "hft" ]
  91.           then
  92.            chhwkbd -d 250
  93.            chhwkbd -r 30
  94. #          open ksh
  95.          fi
  96.          if [ -f /usr/lpp/X11/bin/xinit ]
  97.             then
  98.               if [ "$TERM" = "hft" ]
  99.                 then
  100.                     echo ".....start X11 with xinit -bs !"
  101. #                   /usr/lpp/X11/bin/xinit -bs
  102.                 else
  103.                   if [ "$DISPLAY" = "xst1:0" ]
  104.                     then
  105.                        echo "AIX-Windows started with backing store option .
  106. .."
  107.                        /usr/lpp/X11/bin/xinit -bs
  108.                     else
  109.                       /usr/lpp/X11/bin/xinit
  110.                   fi
  111.               fi
  112.           fi
  113.  fi
  114. #-------------------------------------------------------------------#
  115. # This is the end of the .profile                                   #
  116. #-------------------------------------------------------------------#
  117.  
  118. #!/bin/ksh
  119. # @(#) Just a nice $HOME/.kshrc
  120. #-------------------------------------------------------------------#
  121. #  File   : $HOME/.kshrc                                            #
  122. #                                                                   #
  123. #  Date     : 90/09/29  (yy/mm/dd)                                  #
  124. #  Update   : 92/04/23  (yy/mm/dd)                                  #
  125. #  Author   : F. Kraemer                                            #
  126. #  Abstract : ksh ENV file which is called from                     #
  127. #             $HOME/.profile if invocted in interactive mode        #
  128. #-------------------------------------------------------------------#
  129. #  Use vi command line editing                                      #
  130. #-------------------------------------------------------------------#
  131. # set -o vi
  132. # typeset -x FCEDIT=vi
  133. #-------------------------------------------------------------------#
  134. #  Use emacs command line editing                                   #
  135. #-------------------------------------------------------------------#
  136. set -o emacs
  137. typeset -x FCEDIT=/bin/ed
  138. typeset -x VISUAL=emacs
  139. typeset -x EDITOR=/bin/ed
  140. typeset -x CDPATH=:
  141. typeset -x E3_FILE="${HOME}/.noname"
  142. #-------------------------------------------------------------------#
  143. #  Use 'exit' to quit from login shell and do not log functions     #
  144. #-------------------------------------------------------------------#
  145. set -o ignoreeof
  146. set -o nolog
  147. #-------------------------------------------------------------------#
  148. #  create a different history file for each "window"                #
  149. #-------------------------------------------------------------------#
  150. ttyname=$(tty)
  151. HISTFILE=${HOME}/.sh_history
  152. HISTSIZE=128
  153. #-------------------------------------------------------------------#
  154. #  alias definitions                                                #
  155. #-------------------------------------------------------------------#
  156. # alias rn="rn -e -L -M"
  157. # alias source="."
  158. #-------------------------------------------------------------------#
  159. #  directory aliases                                                #
  160. #-------------------------------------------------------------------#
  161. alias -x dir="/bin/ls -la"
  162. alias -x la="/bin/ls -CFa"
  163. alias -x ll="/bin/ls -la"
  164. alias -x lt="/bin/li -vSm"
  165. alias -x cd..="cd .."
  166. alias -x o="open ksh"
  167. #-------------------------------------------------------------------#
  168. #  Screen management commands                                       #
  169. #-------------------------------------------------------------------#
  170. alias -x cls="tput clear"
  171. #-------------------------------------------------------------------#
  172. #  Fancy pg command                                                 #
  173. #-------------------------------------------------------------------#
  174. alias -x pg="pg -cnsp[%d]"
  175. #-------------------------------------------------------------------#
  176. #  System management commands                                       #
  177. #-------------------------------------------------------------------#
  178. alias -x halt="/usr/sbin/shutdown -F"
  179. #-------------------------------------------------------------------#
  180. #  Print commands                                                   #
  181. #-------------------------------------------------------------------#
  182. # alias lp=/bin/print
  183. # alias qp="/bin/print -q"
  184. # alias can="/bin/print -ca"
  185. # alias -x kprint=print;
  186. # alias -x print=/bin/print;
  187. #-------------------------------------------------------------------#
  188. #  Program development commands                                     #
  189. #-------------------------------------------------------------------#
  190. # alias tout="tail nohup.out"
  191. # alias nake="nohup nice lm LIST=LIST &"
  192. # alias vl="EDITOR=vi $KUB/vl"
  193. #-------------------------------------------------------------------#
  194. #  Status commands for this terminal/user                           #
  195. #-------------------------------------------------------------------#
  196. # alias pst="ps -t $TTYNAME"
  197. # alias psu="ps -u $LOGNAME"
  198. # alias psf="ps -ef | fgrep"
  199. #-------------------------------------------------------------------#
  200. #  build prompt                                                     #
  201. #-------------------------------------------------------------------#
  202. myid=$(id | sed -n -e 's/).*$//' -e 's/^.*(//p')
  203. if [ ${myid} = root ]
  204. then    typeset -x PSCH='#'
  205. else    typeset -x PSCH='$'
  206. fi
  207. #-------------------------------------------------------------------#
  208. # Make sure some environment variables are set for TTYNAME and HOST #
  209. #-------------------------------------------------------------------#
  210. typeset -x TTYNAME=$(tty | sed "s/^\/dev\///")
  211. if [ -z "$HOST" ]
  212. then    typeset -x HOST=$(hostname)
  213. fi
  214. #-------------------------------------------------------------------#
  215. #  Use color just on hft                                            #
  216. #-------------------------------------------------------------------#
  217. if [ "$TERM" = "emacs" ] \
  218.         || [ `echo $TTYNAME|sed -n -e 's/^tty/tty/p'` ]
  219. then
  220.        typeset -x PSPF="$myid@$HOST:"
  221. else
  222.        typeset -x PSPF="$myid@$HOST:"
  223. fi
  224. #-------------------------------------------------------------------#
  225. # Nice prompt.                                                      #
  226. #-------------------------------------------------------------------#
  227. if [ "$TERM" = "emacs" ] \
  228.         || [ `echo $TTYNAME|sed -n -e 's/^tty/tty/p'` ]\
  229.         || [ `echo $TTYNAME|sed -n -e 's/^pts/pts/p'` ]
  230. then
  231.         typeset PS1='${PSPF}${PWD}>'
  232. else
  233.         typeset PS1='${PSPF}${PWD}> '
  234. fi
  235. #-------------------------------------------------------------------#
  236. #  EOF                                                              #
  237. #-------------------------------------------------------------------#
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246. .----------------------------------------------------------------------.
  247. | E-Mail: FRANVM3(KRAEMERF)                 - IBM VNET  "Yes, I'm one  |
  248. | ======  IBMMAIL(DEIBM27S)                 - IBM-Mail   of those      |
  249. |         DE.IBMX400.IBMMAIL.KRAEMER.KRAEME - X.400      stupid IBM    |
  250. |         kraemerf@franvm3.vnet.ibm.com     - Internet   field SE's."  |
  251. | Voice : +49-(0)611/776-364                                           |
  252. | Mail  : Abraham-Lincoln Street 26, 6200 Wiesbaden, Germany           |
  253. '----------------------------------------------------------------------'
  254.