OS/2, Unix Style

OS/2, Unix Style

INTERNATIONAL EXTRA REVIEW OS/2, Unix Style Tom Yager he promise of OS/2 is to release Hamilton C Shell This rule doesn't always apply, how­ users and developers alike from ever. While both shells provide the abil­ the shackles of8088-compliant ity to run processes in the background, Tenvironments. Lifting the 640K­ andMKSOSI2 the Hamilton C Shell offers a more Unix­ byte memory restriction opened the door like implementation. With the C Shell, to all kinds of more potent applications. Toolkit provide you can list background jobs with ps and In this case, the applications are a pair of terminate them with kill (Unix com­ Unix-type shells that add command-line mandsthat the MKS Toolkit does not and interpreted language-processing ca­ Unix-like shells provide). In fact, background jobs pabilities to OS/2. started from the MKS Toolkit shell seem Hamilton Laboratories has created its !orOS12 unstoppable. own version of the popular Berkeley C shell, the Hamilton C Shell 1.04. Its Command-Line Processing name is derived from the C-like syntax of The ability to interactively edit the com­ its shell scripts. Mortice Kern Systems' mand line is something relatively new, MKS OS/2 Toolkit 3. 1 includes a port of start-up commands from a home direc­ even to Unix. The standard Unix C shell AT&T's Kornshell (named for the shell's tory. OS/2 has no concept of separate doesn't have this capability, although original author, David Korn). This shell users, so this home directory is defined modified versions exist that can handle is a superset of an older AT&T invention, through an environment variable. The it. The Hamilton C Shell features a com­ the Bourne shell. shells also require the definition of a sep­ fortable mix of command history and Both packages include a variety of arate command search path, usually via editing, using the editing keys. The up Unix-like commands to make the OS/2 the start-up files. and down arrow keys scroll through pre­ environment a bit more palatable. Hamil­ Several commands that OS/2 users viously entered commands, and other ton ships 22 additional executable files take for granted are implemented inside keys act as labeled. The MKS Toolkit with its C shell, while MKS provides CMD.EXE, the default OS/2 command shell follows the lead of its implementer, 102. Still, the Unix user trained to type interpreter, and disappear when an al­ providing command-line editing in the ls and pwd will derive great comfort ternative shell is used. The Hamilton C style of either vi, the standard Unix full­ from the availability of these and other Shell is shipped with aliases that invoke screen editor, or EMACS, a popular al­ frequently used Unix commands. CMD.EXE to execute the built-in com­ ternative. In this case, only the arrow To install the C Shell, you manually mands, such as DIR and COPY. You can keys have significance. Other functions copy its executable files to their own modify the MKS Toolkit shell similarly, must be invoked through editor-specific directory on the hard disk. The binary but the· standard configuration includes commands or control sequences. Users files are in a subdirectory ( \ bin) on the no predefined aliases for OS/2 com­ familiar with either vi or EMACS will floppy disk. Next, you execute a utility, mands. feel right at home. dumpenv; it resides in the floppy disk's This brings up an interesting point Both shells maintain a running history root directory and must be copied sepa­ about the differences between the two of shell commands, and you can reinvoke rately. shells. The MKS Toolkit shell mimics a previously executed command lines by The MKS Toolkit includes an installa­ Unix environment as closely as possible. reference, using either the command's tion utility, but it also offers the option of When a decision had to be made between sequence number or a portion of its con­ copying the files manually. The auto­ Unix behavior and that of OS/2, Unix tent. The C Shell is a little better at this, matic installation places files in Unix­ frequently won out. As a result, file­ since a command line can refer to any like directories under the directory that names are built with forward slashes (I) number. of previous commands. For in­ is named in the environment variable instead of backslashes, and the escape stance, to reexecute the first three com­ ROOTDIR. (or "next character is literal") character mands of the session, the C Shell se­ is the backslash, not OS/2's caret C). In quence would be !1; !2; !3. The MKS Using the Shells contrast, the Hamilton C Shell is built to Toolkit shell mechanism provides no Both shells run in either full-screen or let experienced OS/2 users adapt with such straightforward way to combine windowed mode, and it's easy to set up little hassle. The default filename, es­ previous commands. It does, however, selections for them in the Start Programs cape, and command option characters allow editing the history file so that you window. As in Unix, both shells read are those of OS/2. continued Reprinted with permission from the February 1990 issue of BYTE Magazine. Copyright © by McGraw-Hill, Inc., New York 10020. All rights reserved. OS/2, UNIX STYLE to the C shell might be better off finding cided edge; it's likely that the size of the another tutorial. I'm familiar with the shell script could have been cut by a Unix versions of the C shell but was con­ Company third. Instead, I used only features inter­ fused by some of the manual's tutorial Hamilton Laboratories nal to each shell, plus selected external sections. Even so, it would be possible 13 Old Farm Rd. commands that I couldn't do without. for a newcomer to grasp the shell, armed Wayland, MA 01778 Both scripts make use of defined func­ with the manual and plenty of time to try (508) 358-5715 tions, string arrays, and other program­ the examples and permute them into use­ Hardware Needed oriented features of the languages. The ful variations. IBM PC, AT, PS/2, or compatible options list, read, delete, and send are The MKS Toolkit manuals show ex­ themselves separate functions. Listing cellent organization, but the content Software Needed message headers requires reading every needs work. The reference manual is laid OS/2 1.1 or higher, or SDK 1.06 or message file and displaying lines starting out as Unix documentation, so anyone fa­ higher with From: , Subj ect: , and Date: . miliar with Unix should find his or her The MKS Toolkit shell script came to­ way easily. In the case of the MKS Tool­ Documentation gether quickly and ran smoothly at the kit shell, however, built-in commands User's guide; reference manual first attempt. This shell's ability to open like fc and export have their own refer­ Price and. close files from within a script made ence·pages and little or no mention (ex­ $350 programming easier. While the syntax cept to "see also") on the shell page it­ took some getting used to, this capability self. This forces the reader to jump allowed the entire mail system to fit into .around the document, when all the shell­ a single script. related information should have been can modify a range of commands and The C Shell was only a little niore dif­ presented under sh, the command used then reexecute them in modified form. ficult to manage, lacking the ability to to invoke the MKS Toolkit shell. This open and close files on the fly. It is, how­ scattering also hampers application de­ Shell Programming ever, robust in its own right, and al­ velopment and seems to be a throwback In addition to their regular duties as though the "list headers" function had to to DOS and OS/2 manuals. Users of command-launching platforms, these be split into a separate script, control these environments might enjoy MKS shells are potent, capable, interpreted passed to and from it quickly and unno­ Toolkit's layout. languages. Aside from original pro­ ticeably. The MKS Toolkit user's guide is bet­ grams, several scripts in the public do­ There was no significant difference in ter. The most complex of the MKS Tool­ main serve a variety of useful functions. speed. Both shells hesitated for a bit be­ kit's commands are covered by tutorials However, since the C Shell and MKS' fore executing while they cached the in this manual, and they are reasonably Toolkit shell are both native to Unix, function definitions, but once the func­ good. The coverage is limited, and you most available scripts would expect to tions began running, performance was shouldn't expect to be introduced to all, make use of Unix features and com­ satisfactory. or even most, of a command's features. mands not available under OS/2. The The effort required to pull together Upon finishing the tutorial, you'll have a MKS Toolkit, which includes nearly all working scripts was minimal: The MKS good feel for the command. the most widely used Unix commands, is Toolkit shell version took about 2 hours better suited to adapting existing scripts; to produce, and the C Shell took a bit Worthwhile Shells most of them should run with few modi­ longer. The MKS Toolkit shell script I consider very few products, as a class, fications. was only slightly smaller at 150 lines, indispensable. These shells fit comfort­ The C Shell, however, because of its compared to the C Shell's 187 lines.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    2 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us