MasterClass September 95 A word in your shell-like.. Hopefully by now you'll be very familiar with the Shell, and if you are anything like me, you'll have the Shell icon left out on the Workbench ready for action. I use the Shell for everything from general file maintainance to logging into the Internet: it's that useful. What you might not know is that every Shell has a few little tricks hidden away up its sleeve (well, tool types), and with a little experimenting you can customise your Shells to your own requirements. One of the easiest things to change in the Shell is the prompt. Normally the prompt is a bit boring, but tells you two things: firstly the process number, and secondly the current directory, like this: (shell1.iff) It's a familiar sight, and undoubtedly useful. However, you can change the prompt to be whatever you want, and the way to do this is with "prompt" AmigaDOS command. Prompt will take and display a string as your new marker, so for example, if you were a UNIX fan you might want to try the following: prompt "$ " which will result in a Shell which looks like this: (shell2.iff) It's short and sweet, but not very useful. More advanced settings are possible if the string you supply has as %S in it somewhere, as the Amiga will substitute the current directory. Try this: prompt "%S> " for this effect: (shell3.iff) The other special code which is recognised is %N which indicates the task number of the Shell. This is the number which the "status" command will return. The standard Shell prompt is therefore: prompt "%N.%S> " You might be wondering where the default prompt string is set, after all you don't need to enter anything to get the normal string. The answer is in a special startup-sequence especially for the Shell. You can examine it by entering: type s:shell-startup or even edit it by entering: ed s:shell-startup You should see the prompt definition in this file, and this is where you would change it if you wanted to make the changes permanent. Every Shell which is opened opens looks to this file for it's initial settings. Any alterations you make therefore won't change the current Shell, but any others opened afterwards. This startup file is also a good location to stick a few aliases. "Alias" is an AmigaDOS command which will rename a command for you. The best example would be something like this: alias bye endcli Once you insert this into the startup file (or type it at the prompt for a once off demonstration), you can stop any new Shell simply by typing "bye". As it is also possible to enter control sequences into the Shell (a control sequence contains characters which when placed in a special order cause a specific action to take place) so you might want to enter an alias like this: alias cls "echo *"*e[0;0h*e[j*" " and see what happens. Here are some other special alias commands which use control sequences for you to try. You can type them into the Shell if you want, or use them in the shell-startup file so that they happen every time you open a Shell window. Notice how the special ESC character is *e, but to use it with an echo command you need an extra * outside the quotes. If you were entering the echo by itself (remember, echo simply displays a string on-screen) you would not need the extra asterisk -- try this: echo "*ec" It might seem complicated, but experiment and you'll soon work it out. Here are some commands you might find fun to play with. There are others which can alter the position of text within a Shell window: useful if you enjoy experimenting with different fonts. alias bold "echo *"*e[1m"" alias italic "echo *"*e[3m"" alias line "echo *"*e[4m"" alias invert "echo *"*e[7m"" alias plain "echo *"*e[0m""