HP3000-L Archives

January 1997, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Michael D. Hensley" <[log in to unmask]>
Reply To:
Date:
Thu, 23 Jan 1997 13:21:05 +0000
Content-Type:
text/plain
Parts/Attachments:
text/plain (204 lines)
A *lot* of this was stolen from other posters; I tried to give credit
where due.  I'm reposting it because I haven't seen it all
consolidated in one place.


How To Actually Make POSIX Usable on MPE/iX 5.5
-----------------------------------------------

Conventions: commands preceeded by a ":" should be typed at the
   MPE/iX prompt; commands preceeded by a "$ " should be typed
   in the posix shell.

======================================================================

A) The file permissions are wrong on a *lot* of files.  The first
   thing you will probably run into is the message
      Unknown terminal "hp2392a"
   in response to various commands (tput, tabs, vi...).  To fix
   this, log on with SM capability and do:
      :sh
      $ chmod +R 555 /usr/lib/terminfo

======================================================================

[The following was posted by Lars, used without permission]
B) There are still more, e.g. /usr/man for non-SM users...
   Here is a workaround (I stole it from the respective SR),
   that can be used to fixup those odd 5.5 permissions.

   1. Restore hfsfiles.hp36431.support from the FOS tape.  (This file
      will be used just to get a list of the files which we need to
      modify).

   2. :tobyte.hpbin.sys "hfsfiles.hp36431.support /tmp/tarfile"

   3. :SH.HPBIN.SYS -L

      shell/iX> for file in `tar tvf /tmp/tarfile 2>/dev/null |
      >         grep -v '^d' | cut -c 57- `
      >         do
      >         chmod 444 $file
      >         done
      shell/iX> exit

   NOTE: The quote which preceeds tar and follows 57- in the above
         command is the "backward" quote usually found as the top-left
         key on a keyboard and those surrounding the ^d are normal
         single quotes.

   4. :purge /tmp/tarfile
      :purge hfsfiles.hp36431.support
[Thanks, Lars!]

======================================================================

C) Ok, now how about those pesky arrow keys in vi?
[I stole this answer from Danny A. van Delft]
   Create a file  named .exrc, which contains the following:

   :map ^V^[U ^V^F
   :map ^V^[V ^V^B
   :map ^V^[B j
   :map ^V^[A k
   :map ^V^[C l
   :map ^V^[D h
   :map ^V^[h 1G
   :map ^V^[F G
   :map ^V^[Q i
   :map ^V^[P x

   Note that ^V stands for <CTRL>V and ^[ for <ESC>, all literal. You
   need the ^V to tell ex that the next character should taken
   literal, not interpreted.  (And the leading ":" has nothing to do
   with MPE here.)
[Thanks, Danny!]

======================================================================

D) Add "HPBIN.SYS" to your path:
      :SETVAR HPPATH=HPPATH+",HPBIN.SYS"
   (You need to add this to your OPTION LOGON UDC.)

   Also, optionally
      :SETCATALOG HPPXUDC.PUB.SYS;SYSTEM;APPEND
   for a few handy UDC's.

======================================================================

E) Finally, fix up your /etc/profile file (which gets executed
automatically
   whenever anyone invokes the shell):

[The attributions on this one are complex, but I stole it from Jeff
Vance, and he credits John Korb]

On Wed, 21 Aug 1996 12:12:04 -0400 (EDT) John Korb said:
>Jeff, perhaps you can help (yes, I have more questions!).
>I'd like to invoke the shell to execute a single command but not have
>the shell's banner displayed.

Hope you can use 'vi' to edit bytestream files (if not, that's an
experience in itself)... anyway...

In the file /etc/profile you probably want to make some changes (this
is 5.5 but 4.0 is markedly similar) anyway, so let me take this
opportunity to list the fundamentals of this file which is executed
when you invoke the shell. I won't list the whole file here, but these
lines should be easy enough to find.  The quick answer to your
original question is #6 below, if you're in a hurry :-)

-----change #1-----
# set up the default path to include only the .2 utilities and the
# current directory
export PATH='/bin:.'
             ^^^^^^
If you are using Gnu/gcc/perl/etc., you can take Mark Klein's earlier
suggestion of aliasing make to the Gnu make and adding /usr/local/bin
after /bin above yielding '/bin:/usr/local/bin:.' or you can avoid the
alias by putting /usr/local/bin first (sort of the HPPATH idea of
system stuff last, not first) for '/usr/local/bin:/bin:.'  Many would
argue that the trailing '.' is unnecessary/dangerous, and I rather
agree (if you want to execute something locally, you have to './foo'
instead of 'foo' but so what).  Let's go on...

-----Change #2-----
# Set up the default user prompt.
export PS1='shell/iX> '
                   ^^^
Stan (I think) previously pointed out that a '>' in the prompt string
can bite you with an HP terminal should you hit 'enter' rather than
'return' :-) If you leave it, at least add a "set -o noclobber" to
avoid messes.

-----Change #3-----
# default for the term variable is the supported HP terminal
# definition. NOTE: the only supported terminal definitions are
# 'hp2392a' and 'ansi'. All other definitions are provided as
# user-supported software only!
export TERM='hp2392a'

Gee, what if you are a vt100?  Our logon UDC determines TERM (well, it
can find an HP terminal; if that test fails we assume vt100) so I
would change this line to:   export TERM=${TERM:-hp2392a} This will
retain the current value of TERM if it is defined, otherwise it takes
the default value of 'hp2392a'.

-----Change #4-----
# Set the following variable to the appropriate value for the timezone
# you are in. Refer to the timezone manual page in section 5 of the
# reference manual for more information.
export TZ=GMT0
          ^^^^
I dislike that one terribly.  Most of you 'should' be setting TZ
already since C/iX used this for times, and now COBOL post85 functions
do also. Using the same logic as #3, change to:  export
TZ=${TZ:-EST5EDT} Since the MPE routines dependent on TZ now 'default'
to EST if TZ isn't set this mimics MPE behavior (but of course you'd
want to use your own timezone). I'm trying to keep this "generic"
enough for HP to apply to the FOS (hint...)


-----Change #5-----
# Define a number of aliases for common MPE/iX commands
alias -x copy="callci copy"
alias -x listf="callci listfile"
alias -x listgroup="callci listgroup"
alias -x listuser="callci listuser"

These are useful I guess, and you can expand as much as you like; but
what is really missing is: alias -x telnet="/SYS/ARPA/TELNET" alias -x
ftp="/SYS/ARPA/FTP" alias -x mover="/TELESUP/PRVXL/MOVER"  (or
whereever you put your copy)

-----Change #6-----
# Clear the screen, set the tab stops and print out the message of the
# day Note - if your system is using terminal types other than the
# default HP2392a, the clear will not work properly since sends codes
# to clear the screen based on the setting of TERM
tput clear
tabs
cat /etc/motd

OK, for those of you that don't like the screen cleared, delete or
comment out the 'tput clear'.  You pretty much need the tabs.  And
here you are, John, if you don't like that banner remove or comment
out 'cat /etc/motd'. And if you want a banner but would like to make
your own, edit /etc/motd and put in whatever you like.

-----Change #7-----
This is an additional line; you can put it up with #1 or anywhere else
in the file.  If you're using Gnu/perl/etc, you will need to set
MANPATH to look in the man pages directory for Gnu.  Add the line:

export MANPATH="/usr/local/man:/usr/man"

======================================================================

Now pick up copies of GNU C++, Perl, Python, Java, and the WWW server
and have fun!
---
Michael D. Hensley             | [log in to unmask] (personal)
Software Development Manager   | [log in to unmask]    (business)
Lund Performance Solutions     | http://www.lund.com

ATOM RSS1 RSS2