sj showjob **** ls listf *** ll listf ,2 ***This file contains three commands. If you type the command "sj", the system will execute the command "showjob". Similarly, if you type the command "ls", the system will execute the command "listf", and if you type the command "ll" the system will execute the command "listf ,2". Next, we'll show you how to put keywords on your UDCs. The first line of the udc defines the name of the command that you're defining, followed by the names of the keyword or keywords, and any default values you may want to assign. The body of each UDC references the keywords using a "shriek" character (!) followed by the keyword itself. Here's a simple example:
p file print !file ***This UDC defines a command called "p". When you type the command "p", you must follow it by a filename. For example, if you type the command
:P MYFILE
MPE will automatically expand this to:
:PRINT MYFILE...
Here are some more examples:
ls <----- If you type "ls", the system will
listf execute the command "listf" with no
*** keywords. But if you type the
ll name <----- command "ll", you *must* supply a
listf !name,2 filename. (E.G :LL MYFILE) and
*** MPE will do a :LISTF MYFILE,2
dir name,level=2 <----- You can give a default value to
listf !name ,!level a keyword if you like. So, for
*** example, if you type:
:DIR MYFILE,0
The system will expand that to
:listf myfile,0
But if you type
:DIR MYFILE
MPE will allow "level" to default
to "2", and expand your UDC to:
:listf myfile,2
One more thing. A UDC can contain multiple commands. For example, the old MPE/V PURGE command could only purge one file at a time. For this reason, lots of folks had UDCs on their systems to purge more than one file at a time. Here's an example.
pu file1,file2=$null, file3=$null, file4=$null, file5=$null purge !file1 purge !file2 purge !file3 purge !file4 purge !file5 ***In this example, you can use the user defined "pu" command to purge up to five files. So for example, you can type the command: pu harpo,chico,zeppo,groucho,gummo ...to purge five files named harpo, chico, zeppo, groucho and gummo. If you don't specify all five parameters, then the defaults take effect. For example, suppose you type pu moe, larry, curly MPE will expand the above "pu" user defined command into the following five MPE commands:
PURGE MOE The 1st 3 purge commands use the PURGE LARRY values you supplied in the "pu" PURGE CURLY command. The last 2 purge commands PURGE $NULL take the default value. ($NULL is PURGE $NULL MPE's name of the "bit bucket" or "null file". Any attempt to purge it is ignored...)
UDCNAME OPTION LOGON, NOLIST, NOBREAK FILE tempfile;temp copy comfile,*tempfile tempfile byeBy copying the command file to a temporary file and then having the UDC execute the temporary command file, it allows me to change the command file out from under my users while they are logged on. --JonBackus? Another trick for MPE/iX systems is to use the posix 'mv' command to rename the current UDC. 'mv' lets you rename ANY (non priv) file - even if it's in use. For accessed files, accessors keep accesing a copy of the file they originally opened, which will disappear once the last process that had it open closes the file. Meanwhile, simply :mv.hpbin.sys "/ACCT/PUB/ACCTUDC /ACCT/PUB/OLDUDC" and you're free to move another file in place of the old file (or not). -- ChrisBartram - 09 Jun 2006
| Topic Hp3000Udcs . { Edit | Attach | Backlinks: Web All webs | Printable | History: r2 < r1 More } |
|
Ideas, requests, problems regarding TWiki? Send feedback Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.Hp3000Udcs |