| Front Page | News Headlines | Technical Headlines | Planning Features | Advanced Search |
M.B. Foster Associates Sponsor Message

December 2001

Boosting Your e3000 Productivity


Unix Quickstart for MPE Users

By Neil Armstrong and Bob Green

On November 14 HP announced changes to the future of the HP 3000 platform that will impact all of us. The 3000 platform has a lot of dedicated friends and supporters, Robelle included. HP has given us a five-year notice that they intend to stop supporting the HP 3000. Even after 2006, I’m certain there will be third-party support for the machines. Just this year HP cancelled support on the 10-year old 9x7 line. And immediately a lively business sprang up to provide third-party maintenance for those systems.

For software support, there are incredibly talented vendors offering quality service and products you know and trust: Allegro, Adager, MB Foster, Beechglen and Bradmark, to name a few.

Robelle plans to support the 3000 with improved Qedit and Suprtool products and service as long as we have customers. And our products already run on the HP-UX platform, if you should decide to migrate some of your apps to HP-UX.

Getting Used to Unix

This column is intended to relate the MPE commands and concepts that you are familiar with to similar commands and concepts on HP-UX. This will not be a debate on the merits of MPE/iX versus HP-UX. It is intended to assist the MPE user, programmer, and operator to navigate and use commands on the HP-UX operating system.

HELP

On MPE we had the Help command to find out the meaning of and syntax for various commands. On Unix we have the man command. This is used to display online documents, often referred to as the “man pages.”

Standard Unix divides the man pages into logical sections, but Sections 6 and 8 are not included on HP-UX:

1 User Commands
1M System Maintenance
2 System Calls
3 Functions and Function Libraries
4 File Format
5 Miscellaneous
7 Device Files
9 Glossary

In the man command, you can specify the section to be searched, as in man [-] [section[subsection]] entryname. If you can’t remember that, just remember man man to get help on the man command.

If you don’t specify a section, man searches all the sections in numeric order. If you don’t know the name of the command, you can search for a keyword by doing man -k sty. This gives you a summary of sections and entries where the keyword occurs.

This option only works if you have a man page index file, which can be found in /usr/share/lib/whatis. If your system does not have this file, you can create it easily by logging on as root (superuser) and then doing a catman command. This process takes a long time to run, so we suggest that you run it in the background by putting an “&” at the end of the command: /etc/catman -w &

The man command searches the directories for the man page entries in the order described by the MANPATH variable. This is just like the HPPATH variable on MPE, but it specifically describes the order in which the man command should search for specific man pages. You can see the next page of a man page listing by pressing the spacebar. You can stop a man page listing by pressing “q”.

Use Space Bar Instead of Enter

When you try the man command, you will notice that the help display pauses when it fills the screen. To continue the display, you press the space bar, unlike MPE where you usually depress Enter or type “Y”. The space bar works almost everywhere in Unix to continue a display, while q ends the display and / brings up a string search.

Command Interpreters = Shells

MPE has just two shells: the Command Interpreter and the POSIX shell. But on Unix the shell is just another program. As a result, Unix systems have many different command interpreters, commonly referred to as shells. HP-UX has at least four shells, and you can download more and install them yourself. The four most common are sh, ksh, csh and the Posix shell.

sh - the bourne shell — The Bourne shell, whose default prompt is “$”, is the oldest of the shells and is on every Unix system. It has no job control, is the default shell assigned to root, and is commonly used for writing command files or “scripts”. Note: On HP-UX 10.X, sh runs the POSIX shell by default.

ksh - the korn shell — Our personal choice for shells is the Korn shell, because it is compatible with the Bourne shell and has many features of the “C” shell. Features of the Korn shell include command history editing, line editing, filename completion, command aliasing, and job control. This is the most MPE-like of the shells.

csh - the C shell — The C shell has a default prompt of “%”. It was developed at Berkeley and has lots of tricky features.

One confusing part of Unix systems is that some commands may be specific to a shell while other commands, such as rm and cp, are programs unto themselves. One way of identifying a built-in command is to check for a man page for that command. If you don’t find one, then the command is just a shell command and is documented under the shell name.

Simple commands you will need

Listf = ls — On MPE we commonly use the Listf or Listfile command to look at the attributes of files. On HP-UX we can look at the various attributes of a file with the ls command. To see all the attributes you use ls -l. For example, to see all the attributes of the files with names starting with proc, use:

$ls -l proc*

-rw-rw-r— 1 neil users 968 Feb 1 14:46 proctime.c

-rw-rw-r— 1 neil users 740 Feb 1 14:46 proctime.o

By default, the ls command does not list all the files. To list the files that begin with a period (.), you must use the -a option.

$ls -a –l — This command lists all the files, including config files that start with a period, and it shows all the attributes.

Fcopy, MPEX, and cp

On MPE we could copy files using Fcopy, Copy or the MPEX Copy command. The MPEX Copy command allows the user to specify filesets when selecting file(s). The cp command in HP-UX also allows this by default.

cp source.file destination.file

cp /dev/src/*.c *.c

cp -R /users/me .

Purge and rm

Beginning with MPE/iX 5.0, we could purge files on MPE with wildcard characters. On HP-UX the command for purging files is rm, which stands for remove files, and it has always supported wildcards.

WARNING: Never use rm -r * because this command will remove all the files from the file system, starting from the root directory.

rm file1

rm file*

Rename and mv

On HP-UX the equivalent to the MPE Rename command is mv, which stands for move: mv file1 file2

Overwriting Files

One problem with the cp, mv, and rm commands is that, by default, they do not prompt the user when they are going to overwrite an existing file. To prompt the user before overwriting an existing file, you must use the -i option with the commands. You can make the -i option the default for some commands by putting an alias command in your .profile file. For example, to make rm interactive by default: alias rm=‘rm -i’

File Command

There is a file command on HP-UX, but it is completely different from the file command on MPE. On MPE the file command is used to define the attributes of a file when it is built, or on what device it is built, or to redefine it as being another file.

On HP-UX the file command attempts to determine the type of a file and print it. This is not as easy as it sounds, since Unix has no file labels or file codes to indicate the file type. Instead, Unix looks at the file extension (i.e., .c is C source code) and a magic number at the beginning of some files.

file proctime.*

proctime.c: {C program text}

proctime.o {s800 relocatable object}

On Unix the closest thing to the MPE file command for redirecting files is actually a symbolic link.

This should be enough to get you started on HP-UX. And it will all apply to Linux as well. For many more Unix tips for MPE users, download our full tutorial on this topic in PDF format: www.robelle.com/library/tutorials/pdfs/hpuxmpe.pdf.

 


Copyright The 3000 NewsWire. All rights reserved.

ws PUT subscribers/