More on HP-UX:
Robelle HP-UX Resources
How Robelle products work on HP-UX.
How to learn about UNIX on MPE.
And dozens of useful HP-UX and UNIX web links.

Unix Quickstart for MPE Users

By Neil Armstrong, Suprtool Software Architect, and Bob Green, Robelle President

November 14th 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 5-year notice that they intend to stop supporting the HP3000. Even after 2006, I'm certain there will be 3rd party support for the machines. Just this year HP cancelled support on the 10-year old 9x7 line. And immediately a lively business sprung up to provide 3rd 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 on-line documents, often referred to as the "man pages".

Standard UNIX divides the man pages are divided 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 stty

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 the 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 4 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 of 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 iit 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 can 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, read our full tutorial on this topic in PDF format:

www.robelle.com/library/tutorials/pdfs/hpuxmpe.pdf


For more information on Suprtool for HP-UX, click here. Also, read our Unix Tips, and our case study on Suprtool on HP-UX and MPE at Alliant Foodservice.

For more information on Qedit for Windows, our client/server text editor that works on HP-UX and MPE, click here.


click for more on suprtool/ux

Suprtool/UX: An Old Friend

By Bob Green


Originally published in the 3000 NewsWire

I don't want to minimize the disruption that HP's November 14th announcement will cause some users. The cost to change IT systems is high, especially when switching from a known reliable platform like MPE to a new platform of unknown quality. But these days you do not need everything in your shop on one platform. HP 3000 systems can easily share data with IBM, SUN, HP-UX and Windows, even LINUX. Our web site contains a migration center with application notes on exporting 3000 data to various platforms: www.suprtool.com/move

If you don't panic, I believe you can continue to rely on your 3000s almost as long as you want. Barring technical setbacks, I expect to see faster 3000s next year - there is still the PA-RISC 8700 chip and the Fiber Channel architecture to exploit. At a time of your choice and in a manner of your choosing, you can migrate the applications off your HP 3000. Suprtool from Robelle is already widely used to help integrate HP 3000 systems with HP-UX systems by sharing data. For example, one Robelle customer uses Suprtool/iX and Suprtool/UX to distribute their data from the 3000 to a nationwide network of HP-UX boxes, and then bring new data back to the 3000 for integration. If you decide to migrate some apps to HP-UX, Suprtool/UX will be there for you.

HP Eloquence!

As of March 2002, Suprtool/UX now supports HP Eloquence the TurboIMAGE-compatible database that runs on HP-UX.

We have the same Suprtool commands that you are familiar with on MPE now working on HP-UX, which means that porting batch jobs is a snap. And migrating your data requires no transformations at all: just dump each dataset to a file with Suprtool, FTP it to the target HP-UX system, and load the Eloquence dataset from the file!

What is in Suprtool/UX?

If you are a user of Suprtool on MPE, you will have an easy time with Suprtool on HP-UX, because Suprtool/UX is compatible with Suprtool/MPE and derives from the same core source code.

Suprtool/UX, like Suprtool/iX, consists of a number of components, plus a couple of options. The components are the Suprtool extract/copy/sort utility itself, the Suprlink module for high-performance linking, and STExport for exporting data to other formats. The optional components consist of the Oracle interface and the Allbase interface.

We translate Oracle and Allbase tables and columns into Suprtool data types, which then allows us to reference them in IF selections, Extracts, high-speed Sorts, and Defines to overriding data types. Delete is not supported, but Put is (the command is called Add in Suprtool/UX).

As well, you can insert your own SQL SELECT commands into a Suprtool/UX task. For example,

	>select ename,salary,taxpaid from user.employee 

Self Describing Files

A self-describing file (SD) is one that contains both some data and the description of the data. If you generate an SD file with Suprtool on MPE and transfer it to HP-UX, you can then input it into Suprtool and immediately be able to use the field names. Suprtool can even know which fields are dates (and in what format) and how many decimal places the numeric fields contain.

SD files are moved from MPE to HP-UX using our SDUNIX utiilty which converts the field descriptions from the user labels (not supported on UNIX) to a separate file. Then you just FTP the two files to HP-UX.

SD files are also the key method of preparing data for Suprlink and STExport.

Suprlink/UX

Suprlink is a unique program - it allows you to tradeoff temporary disk space (which is cheap) for clock time, which is always in short supply when doing multi-table extracts. Suppose you need to extract information on a group of students, expanded with related fields from the courses, loans, alumni, grades, and majors tables. The standard technique that most databases use is to randomly retrieve the data for a single student from all tables, then go back to the tables and look up the next student. If you select a large number of students, this method can be quite time consuming, because it uses the disk hardware in the least efficient way possible. In fact, it can take much longer than scanning the entire database serially from start to finish.

With Suprlink, you use Suprtool to serially scan the tables for your selected students, creating a sorted self-describing file from each table. Then Suprlink scans all the extract files simultaneously and merges the related fields together into a new, wider record with all the fields. It can be amazingly fast.

And Suprlink makes just as much sense on HP-UX as it does on MPE.

STExport/UX

The primary Suprtool program provides PRN output, but what if you want to specify exactly how the sign is handled, or change the separator, or specify some other detail of the export file? In that case, STExport is for you. It has endless simple options to adjust the export file, with tips on what is required for common software packages.

For more information on Suprtool/UX, visit our web site.


About HP-UX (with links to many resources).

HP Eloquence and Suprtool on HP-UX

More UNIX Tips from Robelle