4]----------------------------------- 3]THE SHELL GAME: A Continuing Column 3]A Moving Experience in Confusion 3]By Brad Webb 4]----------------------------------- This month you'll learn about what's where on a Workbench disk and what can happen when things are shuffled. For some of the experimentation you'll need a CLI or Shell window. If you know how to get either of these on screen, skip on to the start of the tutorial. Otherwise, consider this: 3]IF YOU'RE NEW HERE The shell and the CLI are special windows. In these windows commands and programs are run by typing, rather than using the mouse and icons as with the Workbench. The CLI is an older, more primitive version of the shell. In this column we concentrate on the newer shell window. We examine uses of the shell itself, utilities and programs you can run from the shell, and the shell's interactions with the familiar Workbench environment. This column provides tutorials and examples to make it easier to follow. You will find a shell icon on Workbench 1.3 and 2.0 disk in the window that opens when you double-click the disk icon. Double-click on the shell icon and you have a window in which you can type the exercises and experiments from this column. If you plan to do the exercises while reading this column, it's best you exit now, open a Shell window and return. If you have displayed this text by clicking on the ShellGame icon in the J: window, toggle between the text and the Shell window by alternately pressing ALT-N and ALT-M. Give it a try to see how easy it is. Before working any exercises, be sure you have started your Amiga with a copy of an unmodified Workbench disk. 3]WHEN PROGRAMS ARE MOVED A request for help inspired this month's column. An Amigan near us received a commercial disk with containing text files tied to icons. When he double-clicked on the Read Me file icons for the supplied documentation, nothing happened. Why, he asked? A quick look revealed the problem and showed why a knowledge of the world of Shells and CLIs is important even for Workbench users. It made me realize the importance of knowing the way a Workbench disk is organized and what happens when someone alters that organization. You can often run into similar problems on PD disks. Let's first describe why our friend had problems. The icons as created by the other Amiga publisher called for the More text display program by a full pathname. That means the icon contained exact information on where to find the program, including a disk name and description of all the directories. It is not always necessary to be so specific but usually there is no problem. The path specified was "sys:c/more". The normal location of More is in the Utilities drawer of a Workbench disk and the pathname should be "sys:utilities/more". Our friend, as yet unfamiliar with the Shell, was unaware of this and didn't know there was a discrepancy. The incident brings up two questions. Why did the publisher call for More in the wrong place? Why is More in the Utilities drawer, if the software publisher, which presumably knows a lot about AmigaDOS, felt the C directory was a good location for it? We'll answer these questions today and along the way look at how a Workbench disk is organized and why. Knowing this can help everyone and especially beginners avoid the sort of confusion our friend fell prey to. 3]TERMS AND DEFINITIONS First, let's explain a few terms. AmigaDOS lets you create shorthand names for locations on your disks. This minimizes typing. These shorthand names are called "Assigns", since you are "assigning" a shorthand name to take the place of a longer one. They have the form of a word or phrase followed by a colon. This makes them look just like a device name such as df0: or dh1: and in fact they can be used in the same way as device names. For example, "sys:" as shown above is short hand for "the disk used to start the computer," usually a Workbench disk. Sys: is derived from the phrase "system disk," long used in computer circles to indicate the disk with the operating system on it. You can type "dir sys:" to get a directory of your boot disk just as you could type in "dir Workbench1.3:" if that was its name, or "dir df0:" if it's in drive df0:. Other common shorthand terms you may see when dealing with moved programs are "c:" which indicates the directory named "C" on the sys: disk, "s:" which indicates the directory "s" on the sys: disk and : (a colon) which means "the disk on which this icon resides." Each of the directories has a special purpose when using AmigaDOS. C: is the repository of AmigaDOS commands (DIR, LIST, CD, ED and so on). S: keeps the system script files such as the Startup-sequence. Script files are text documents containing AmigaDOS commands. The directory names give clues to the purpose of the special directories. SYS: for system is pretty obvious. C: for commands and S: for scripts also make sense. 3]AHA! Now it makes some sense why More was looked for in the C: (sys:c) directory by the disk. More functions as a command; therefore, expecting it to be in the C: directory is not entirely ridiculous. The problem is C: isn't the normal home for More. Open a shell window and type the following command in it: dir sys:utilities You will see the following list if you are using AmigaDOS 2.0: .info AutoPoint AutoPoint.info Blanker Blanker.info Clock Clock.info Display Display.info ED ED.info Exchange Exchange.info IHelp IHelp.info More More.info NoCapsLock NoCapsLock.info Say Say.info . . . and this list if using AmigaDOS 1.3: .info Calculator Calculator.info Clock Clock.info ClockPtr ClockPtr.info CMD Cmd.info GraphicDump GraphicDump.info InstallPrinter InstallPrinter.info More More.info Notepad Notepad.info PrintFiles PrintFiles.info Say Say.info All are very useful programs deserving of the name utilities. Some, such as More, InstallPrinter and Say, could well be considered AmigaDOS commands and be kept in the C: directory. The difference? Each of these utility files has an icon. AmigaDOS commands do not. The Utilities drawer has an icon also, so you can access the programs within by their icons. These programs can also be run from the Shell or CLI. The AmigaDOS commands kept in the C directory are intended only to be used from the Shell or CLI and do not come with icons. A utility, then, is a program considered useful for both users of the Shell/CLI and users of the Workbench and is located in a drawer with an icon so it can used from the Workbench. When some people organize disks intended to be used as boot disks, as this one was, they tend to ignore these distinctions and put all needed support programs in a directory they call C. If you boot your computer with such a disk the computer will always find the programs because it always searches C: (the C directory on the boot disk). It is no problem to make the icons on such a disk refer to C: or sys:c also. However if you instead boot your computer with a standard Workbench disk, the icons on the other disk will be pointing to the wrong place, since c: or sys:c always refer to the disk actually used to start the computer. The people who put together the disk sent to our friend should not have put the specification of SYS: in icons since the disk did not have to be used as a boot disk. If the path name had begun with just a colon, it would have been fine. ":c/more" means "the program More in the C directory of this disk" since : by itself always means "the disk where this icon is physically located". To review: "sys:c/more" means "the More program in the directory named C on the disk used to start the computer" and ":c/more" means "the More program in the C directory on this same disk". Such a little thing, only three letters, but such a big problem for the unwary computer user! 3]THERE WERE THREE ERRORS OK, the disk's had three errors. It figured people would always boot their computers from the supplemental disk rather than a separate Workbench disk. It further specified more of the pathname in the icon's tooltype than necessary. ":c/more" would have worked whether the disk was used as a boot disk or not, since in either case it would have specified the disk the icon was on and been correct. The third error was more subtle. The disk was organized in a non- standard way. An Amiga owner is justified in expecting More to be in the Utilities directory rather than the C: directory. I must admit in the past I have suggested cases where the Amiga owner may wish to do just what the software publisher did. We'll get to that in a paragraph or so. 3]THE SYSTEM DRAWER There is one other Workbench drawer with similar programs - the System drawer. In it reside a series of programs that are about half way between AmigaDOS commands and utilities. These programs function as utilities that affect the computer at a very basic system level such as formatting disks, copying disks and (under 2.0) adding monitors. These programs are less likely to be misplaced on commercial and PD disks. 3]REORGANIZING YOUR OWN DISKS - ANOTHER ERROR? In the past I have urged readers to consider putting SAY and some other commands, MORE included, into the C: directory of their own Workbench disks, especially if modifying the AmigaDOS PATH. This path is a list of directories automatically searched by AmigaDOS for any program or command names you type in a Shell or CLI. This search list is created with the PATH command. You will not inadvertently make programs inaccessible if they are in the C: directory since it is always searched. To see this in action, activate your Shell window and type: path: You will see something like: Current directory Ram Disk: SYS:C SYS:Utilities SYS:Rexxc SYS:System SYS:S SYS:Prefs SYS:WBStartup C: This example is for AmigaDOS 2.0 To add a directory to this list you would type "path add directoryname" in your Shell. Under 2.0 you could remove a directory with "path remove directoryname". Under either 1.3 or 2.0 "path reset" will limit your search to the current directory and c:, and therein lies the danger of using the PATH command. As mentioned above, C: is always included in the path even if you reset it by accident. If you are concerned about doing that, you can put any programs you always want found in the C: directory and they will never be missed. Part of the organization of a Workbench disk then is that the C directory of your boot disk is always searched to see if it contains the command or program called for when typing in the shell. Preparers of PD and commercial disks do things like moving More to C: to take advantage of this fact, just as I have suggested to my readers in the past. The editors do not have to make special efforts to ensure the sys:utilities is added to the path on the disks they set up. Well then, isn't suggesting you consider moving programs this way the same as what the publisher did to its unhappy customer? Not quite. If you make such changes, make them only to your own disks. Any disks you create which others may use should always have the standard organization to avoid confusion. This is the distinction too often overlooked by disk preparers. 3]REPAIRING THE ICONS What do you do when you have a disk where programs like More have been placed in the wrong locations? The most obvious solution is to always boot from the troublesome disk and you'll be fine. That's not a good solution for owners of hard drives or anyone who wants to work in a custom environment. If you've adjusted your Workbench colors or resolution in Preferences, there is no reason you should be forced to do without just because some disks are strangely set up. If you want to use such a disk with your own Workbench disk, there are two approaches you can take. The first is to modify the icons on the troublesome disk so they point to that disk even when it isn't being used as the boot disk. The second approach is to modify the disk icons so they point to the appropriate programs on your Workbench disk or hard disk. Since the situation will vary from disk to disk I will provide you with some general rules to follow and common items to look out for. You will have to apply these as best you can to each case you come across. Since most of the trouble seems to come from documentation files, we'll look at how to deal with them for our example. The Workbench's menu structure has an item that lets you look inside icons to see what's there. This item is called "Info" and is found in the leftmost pulldown menu, called Workbench, under 1.3 and earlier. Under 2.0 the menu item is "Information" and is in the "Icons" pulldown rather than in the Workbench pulldown. To see inside an icon, the steps are these: 1. Click once on the icon for the troublesome file. 2. Pull down the appropriate Workbench screen menu (Workbench pulldown for 1.3 and earlier, Icons pulldown for 2.0) 3. Highlight the Info (1.3) or Information (2.0) item and release the mouse button. 4. In the window that opens, make any needed changes to the "Default tool" type-in-box. 5. Resave the icon by clicking on the window's SAVE gadget. Step 3 will pop open the Icon Information window. Look in the type-in- box labeled "Default tool". This is where you specify the program that will display the text file belonging to the icon. To change the information contained here, use the DEL and Backspace keys, move about with the cursor keys and type any new information you wish. As you type, existing text will move over to make room for your new text. You can erase everything in this box by holding down the right Amiga key, pressing and releasing the X key and then releasing the right Amiga key. 3]SOME TYPICAL TEXTFILE ICON PROBLEMS Here's a list of some of the troublesome items you may find and suggestions on what to change them to. I have listed the problem line first, than an analysis and suggestions: c:more Indicates to look for the More program in the sys: disk's C directory. If you boot with any disk other than the one containing the icon, this will probably be wrong. Change to :c/more to use the More program on the disk with the icon, or to sys:utilities/more to use the program on your Workbench disk or hard drive. :c/more Sometimes this line doesn't fix any problems as suggested above because the preparer of the disk forgot to include a C directory or the More program on the disk. In this case, change the icon to call for sys:utilities/more. c:less, c:muchmore, :c/ppmore, sys:utilities/less, sys:utilities/ppmore Many PD program doc files call for a text display program other than the More program provided with every Amiga. What I have listed here are just a few of the permutations. Sometimes the program is included on the PD library disk but often isn't. If you have problems, you may solve them by changing the line to read as: sys:utilities/more. copy of Workbench1.3:Utilities/Notepad This is an actual example that popped up when I opened a PD disk documentation file at random while researching this column. Remove the words "copy of" and the space after the "of" and everything should work fine. You will find cases where the disk name isn't even Workbench1.3 or sys: and you will have to change it to one or the other. If you have removed Notepad from your Workbench disk, substitute More. 3]IN SUM We ranged over the entire structure of the Workbench disk in terms of what programs are where and dealt a bit with why things are as they are. All this to provide you with some extra ammunition to use when you run into problems with disk setups. There are no immutable in this game, which is why I talked about general disk organization, assigns and the like. Use your general knowledge of these subjects, the hints we looked at, and experimentation. Over time you'll find yourself developing a sort of sixth sense about such matters. 4]END OF TEXT