home *** CD-ROM | disk | FTP | other *** search
/ Vectronix 2 / VECTRONIX2.iso / FILES_01 / MARK_WC3.LZH / BIN / PROFILE < prev    next >
Text File  |  1988-04-27  |  6KB  |  159 lines

  1. # prototype profile for msh.prg 3.0 release (ds. floppy disk)
  2. #
  3. # First order of business: set the environments which the shell uses
  4. # to find commands and create temporary files.
  5. #
  6. # Note that .bin does not need to be listed in PATH.
  7. #
  8. # Since you can rename any function in .bin, eg
  9. #    set in .bin dir=${.bin\ls}
  10. #    unset in .bin ls
  11. # there really isn't any need to put it in the PATH.
  12. # .bin is now always searched first, and the only .bin names
  13. # which are wired into the shell are 'set' and ''.
  14.  
  15. set drive1=$cwdisk:                # get the "boot" drive
  16. set ramdrive=h:                    # a ram-disk here?
  17. setenv PATH=.cmd,,$drive1\bin,$drive1\lib    # set the cmd search path
  18. setenv SUFF=,.prg,.ttp,.tos            # executable file suffixes
  19. setenv LIBPATH=$drive1\lib,$drive1\bin,        # library search path
  20. setenv INCDIR=$drive1\include            # directory for include files
  21. setenv TIMEZONE=CST:0:CDT            # this is the Central time zone
  22.  
  23. # Set up TMPDIR.
  24. # This directory is used by the shell when evaluating 
  25. # `commands` substitutions, so the `getrez` and `getpal`
  26. # below will fail if TMPDIR does not exist or TMPDIR is
  27. # not defined and the default TMPDIR, \tmp, does not exist.
  28. # We check to see if a RAM disk is installed (ramdrive, set above)
  29. # and if it is, we put the tmp directory there, otherwise, we use
  30. # the default drive.
  31. if (drvprs -q $ramdrive) (
  32.     setenv TMPDIR=$ramdrive\tmp        # ramdisk present
  33.     mkdir $TMPDIR                # create tmp directory
  34. ) (
  35.     setenv TMPDIR=$drive1\tmp        # else, use default disk
  36. )
  37.  
  38. # The home directory is used by some commands for default actions,
  39. # for example, the `cd' command with no arguments sets your default
  40. # directory to HOME.
  41. setenv HOME=$TMPDIR                # your directory here
  42.  
  43. # Now we change the screen to a TOS style display.
  44. # You can change this stuff if you like.
  45. # This particular setup duplicates what the previous
  46. # versions of msh did internally, but it reverses
  47. # the video to white on black to reduce screen burn-in.
  48.  
  49. hidemouse            # turn off the mouse cursor
  50. setenv ESC=''            # that's an escape character hiding in there
  51. echo -n ${ESC}E${ESC}e${ESC}v    # clear screen, text cursor on, line wrap on
  52. setenv DEFREZ=`getrez`        # fetch the screen resolution
  53. # the double quotes keep the palette from being split into separate words.
  54. setenv DEFPAL="`getpal`"    # and the screen palette
  55. setenv MSHREZ=$DEFREZ        # initialize our own resolution
  56. setenv MSHPAL="$DEFPAL"        # and our own palette
  57.  
  58. # note that unlike most shells, the 'if' command is being parsed just like
  59. # any other command.  It is the open parenthesis after the if ( expression )
  60. # which continues the command to the next line.  If you wrote:
  61. #    if (equal $DEFREZ 0)
  62. #        ( ... )
  63. # you would get a usage message from 'if' complaining about the missing
  64. # argument, and the shell would run ( ... ) as a separate command.
  65.  
  66. if (equal $DEFREZ 0) (        # if we're in low resolution
  67.     setenv MSHREZ=1
  68.     setrez $MSHREZ            # go to medium resolution
  69.     setenv MSHPAL="0 0 0 0x777"
  70.     setpal $MSHPAL            # and reverse video
  71. )
  72. if (equal $DEFREZ 2) (        # if we're in high resolution
  73.     setenv MSHPAL=0
  74.     setpal $MSHPAL            # just reverse video
  75. )
  76.  
  77. # Miscellaneous settings
  78.  
  79. # the single quotes keep the $cwdisk from being expanded until
  80. # the prompt is evaluated.  otherwise you get the boot drive.
  81. # below are two different prompts, if you want the '$' prompt,
  82. # don't set prompt at all, or do an "unset prompt".
  83. set prompt='$cwdisk>'        # a dos style current drive prompt
  84. set prompt='% '            # a unix style prompt
  85. set history=8            # number of lines of history to keep
  86.  
  87. # the pwd builtin is once again built-in
  88.  
  89. # gemset hacks the screen back to the state it was in when we were
  90. # launched by the desktop.  Gem/Aes/Vdi is not amused by secret
  91. # resolution or palette changes.
  92. set in .cmd gemset=(
  93.     echo -n ${ESC}f        # text cursor off
  94.     setrez $DEFREZ        # reset resolution
  95.     setpal $DEFPAL        # reset palette
  96.     showmouse        # mouse cursor on
  97. )
  98.  
  99. # The reverse of gemset to restore us to shell configuration
  100. set in .cmd mshset=(
  101.     hidemouse        # mouse cursor off
  102.     setrez $MSHREZ        # shell resolution
  103.     setpal $MSHPAL        # shell palette
  104.     echo -n ${ESC}E${ESC}e${ESC}v
  105. )
  106.  
  107. # gem used to be a wired builtin function, now we can write it as a command.
  108. set in .cmd gem=(
  109.     gemset            # set gem screen
  110.     $* 2>aux: >con: <con:    # execute the command
  111.     set t=$status        # get the exit status of $*
  112.     mshset            # restore shell screen
  113.     exit $t            # return the status.
  114. )
  115.  
  116. # the tos builtin is simple:  just make sure the standard handles
  117. # point to the default places, or point them someplace else if
  118. # you like.  You might try 3>aux: if you can't get a serial printer
  119. # to work any other way.
  120. set in .cmd tos=( $* 2>aux: >con: <con: )
  121.  
  122. # here's an example of argument list processing.  display simply prints
  123. # it's arguments with a label one to a line.
  124.  
  125. set in .cmd display=(
  126.     while (is_set in argv 1) ( echo argument: $1; unset in argv 1 )
  127. )
  128.  
  129. # some people find that the history mechanism is difficult to use, and
  130. # that much of this difficulty comes from having to type "set in history"
  131. # to view this history.  The following adds the command "hist" to show
  132. # the history.
  133.  
  134. set in .cmd hist=(set in .msh\.msh\history)
  135.  
  136. # finally, a way to use make if you run out of memory trying to use it
  137. # normally.  'make -n' generates the list of commands needed onto standard
  138. # output, so we catch them in a file and have the shell execute them
  139. # directly.  The only problem is that the shell doesn't quit when one of
  140. # them fails.
  141.  
  142. set in .cmd mymake="make -n > mscript; set verbose; . mscript; unset verbose"
  143.  
  144. # This command will fetch the keyboard clock and use it to initialize
  145. # both the mwc library time() function and the gemdos date and time functions.
  146. # This will keep the time up to date across a warm start so you only need to
  147. # set it by hand when you power up.
  148.  
  149. date `date -i`
  150.  
  151.  
  152. # put the postfile into .cmd for less trouble
  153. set in .cmd postfile=(
  154.     echo -n ${ESC}f        # text cursor off
  155.     setrez $DEFREZ        # reset the resolution
  156.     setpal $DEFPAL        # reset the palette
  157.     showmouse        # mouse cursor on, but the desktop forces it
  158. )
  159.