CommandToolCommands.Tioga
Copyright © 1985, 1986 by Xerox Corporation. All rights reserved.
Russ Atkinson (RRA) April 8, 1986 10:19:26 pm PST
COMMANDTOOL COMMANDS
COMMANDTOOL COMMANDS
CEDAR 6.0 — FOR INTERNAL XEROX USE ONLY
CEDAR 6.0 — FOR INTERNAL XEROX USE ONLY
CommandTool Commands

© Copyright 1984, 1985, 1986 Xerox Corporation. All rights reserved.
Abstract: This document is a user's guide for the default commands provided by the CommandTool in Cedar 6.
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304

For Internal Xerox Use Only
Commands
This document lists the commands available through the Command Tool (see CommandToolDoc.tioga for additional information), or are registered with the Commander after a full boot. The commands are (mostly) listed in alphabetical order for ease of reference. The exceptions are the working directory commands, which are listed at the end of this document. Level-clipping this document is a good way to browse the command list. Where commands are registered under additional names, the additional names are in parentheses following the "official" names.
The syntax of commands is given along with the command name. As examples:
{directory}* denotes zero or more directory specifications
fileName  denotes exactly one file name specification
{number}  denotes an optional number specification
{*}   denotes the rest of the command line
Many of the these commands can accept switch specifications. Unless otherwise specified, switch specifications always start with "-", they can occur in any position, and they affect the sense of named switch for the remainder of the command line. For example, "-ax~d" causes the A and X switches to be set to TRUE, and the D switch to be set to FALSE.
Abort
Raises the error ABORTED. This command will cause itself to exit abnormally. It will also have the effect of unwinding all nested instances of the command tool.
examples
The simple example:
% Abort
...Aborted
Suppose that Abort1.cm contains "Abort2.cm\nDate\n" and Abort2.cm contains "Abort\n":
% Abort1.cm
> Abort2.cm
>> Abort
...Aborted
Notice that the Date command was not executed.
AddDebugSearchRules {directory}*
The symbol table machinery, in particular, the interface AMFiles, maintains a list of directories in which to look for symbols and source files. This command changes that list by adding each of the directories on the command line to the end of the search list. If a directory is already there, it will not be added again.
Related commands are SetDebugSearchRules and PrintDebugSearchRules.
examples
% PrintDebugSearchRules
( /// )
% AddDebugSearchRules ///Junk/ ///Acme/
% PrintDebugSearchRules
( /// ///Junk/ ///Acme/ )
%
warnings
AddDebugSearchRules does not make many consistancy checks on directory names.
AddSearchRules {directory}*
Adds a directory to the tail of the CommandTool search rules.
examples
% PrintSearchRules
( ///Commands/ )
% AddSearchRules ///Wierd /Ivy/Stewart/Commands/
% PrintSearchRules
( ///Commands/ ///Wierd/ /Ivy/Stewart/Commands/ )
warnings
Like SetSearchRules, AddSearchRules makes little attemp to check the validity of its arguments.
Alias newName {(nameList)} {*}
Aliases provide a substitution macro facility for the first token on a line. Alias bro bringover /o will cause bro mumble to be expanded into bringover /o mumble. Aliases can also be given an (optional) argument list, in which case the tokens on the command line following the alias name will be substituted for the formal parameters, e.g., Alias brob (file df) bringover /a /o file.mesa file.bcd df would cause brob rope rigging to expand to bringover /a /o rope.mesa rope.bcd rigging.df.
Most things that can be done with Alias can also be done with command files.
examples
% Alias Backup List -u *!H
% Backup
AliasDoc.tioga!2
Binder.Log!1
commandtool.df!12
% Alias
Boot {volume}
Boot boots the specified volume (default is the current running volume) with the given switches.
examples
% Boot -f
(performs a full boot of the current volume)
% Boot
(performs a normal rollback boot of the current volume)
CacheFindExcessVersions {pattern}*
CacheFindExcessVersions finds excess versions of files in the file cache. Excess versions are all versions other than the highest numbered version of a file.
examples
% CacheFindExcessVersions /Indigo/*fs.df
[Indigo]<Cedar5.3>Top>FS.df!1
CacheKillExcessVersions {pattern}*
CacheKillExcessVersions flushes excess versions of files in the file cache. Excess versions are all versions other than the highest numbered version of a file. The K switch can be used to indicate that the following number is the number of versions to keep.
Checkpoint
Create a checkpoint. This is a simple interface to Booting.Checkpoint and is otherwise the same as the procedure called by the Checkpoint button in the herald.
examples
% Checkpoint
Creating checkpoint at April 23, 1985 9:19:18 am PST
made by Atkinson.pa
...
ClearMenu
ClearMenu restores the Command Tool menu to its initial pristine state, with only the STOP!, Find, and Split buttons. For shared machine users, this command is useful to execute prior to establishing your own personal buttons.
Copy {pattern}*
The copy command has three forms
Copy toFile ← fromFile
This form copies the file named by fromFile to the file named by toFile.
Copy toDirectory ← {pattern}*
This form copies all files matching the patterns into the directory named toDirectory. Using the R switch will retain the subdirectory structure of the patterns.
Copy {pattern}*
This form copies all files matching the patterns into the local directory under local names. Using the R switch will retain the subdirectory structure of the patterns.
The copy command is a thin veneer user interface to FS.Copy. In particular: FS.Copy[from: from, to: to, keep: createKeep, attach: TRUE]. FS.Copy will be called with attach: FALSE if the -c switch is set. FS uses the current working directory if either to or from are not full path names.
createKeep is a global variable in FSFileCommandsImpl, and can be set by the interpreter (the default is 2).
The version of the "to" file created is one larger than the existing !H version, unless "to" is a GName on a server that does not support version numbers, in which case an existing global file will be overwritten.
Case 1: "to" is a GName and "attach" is FALSEFS does an FS.Open[from, read, wantedCreatedTime, remoteCheck, wdir] and stores the contents and properties of the opened file directly in the new "to" file on the remote server.
Case 2: "to" is an LName and "attach" is FALSEFS does an FS.Open[from, read, wantedCreatedTime, remoteCheck, wDir] to generate a "from" open file, and FS.Create[to, setKeep, keep, wDir] to generate a "to" OpenFile. The contents and properties are copied from the "from" OpenFile to the "to" OpenFile, and both are closed. (In the case of copying from an uncached global file, the global file is not added to the cache. The only pages allocated on the local volume are those needed to hold the target local file.)
Case 3: "to" is a GName, "attach" is TRUE, and "from" is a LName — Things proceed as in case 1, except a "write" lock is acquired for the "from" file. Once the transfer is completed, the LName is attached to the GName. Case 3 is used by "SModel".
Case 4: "to" is an LName, "attach" is TRUE, and from" is a GName — Like case 2 except that instead of an actual transfer of contents and properties, the LName is attached to the GName / created-time. If no "wantedCreatedTime" is specified, or if "remoteCheck" is TRUE, then FS.FileInfo[to, wantedCreatedTime, TRUE] is performed first to determine/check the version number and created-time for the GName and any resulting FS.Error is passed on to the client. When "remoteCheck" is FALSE (but a wantedCreatedTime" is specified) then the attachment is made to the "from" and "wantedCreatedTime" arguments without checking either the remote server or the cache. Case 4 is used by "BringOver".
Case 5: both "from" and "to" are LNames, or both are GNames, and "attach is "TRUE" — FS proceeds as though "attach" were FALSE (see cases 1 and 2 above).
examples
% Copy TrapsImpl.bcd ← /indigo/PreCedar/MesaRuntime/TrapsImpl.bcd!1
% Copy /Ivy/Stewart/Temp/Compiler.log ← Compiler.log
%
% CD ///test/
% Copy /ivy/stewart/temp/W*
///test/w1aw.txt ← [ivy]<Stewart>temp>w1aw.txt!3
///test/WFReal.mesa ← [ivy]<Stewart>temp>WFReal.mesa!1
///test/wfrealimpl.mesa ← [ivy]<Stewart>temp>wfrealimpl.mesa!4
///test/wfrealtest.mesa ← [ivy]<Stewart>temp>wfrealtest.mesa!4
///test/wink.mesa ← [ivy]<Stewart>temp>wink.mesa!1
%
% Copy ///test/ ← /ivy/stewart/temp/protocol.txt /ivy/stewart/temp/printcl.bcd
///test/protocol.txt ← [ivy]<Stewart>temp>protocol.txt!1
///test/printcl.bcd ← [ivy]<Stewart>temp>printcl.bcd!1
%
warnings
There is presently no way to change the value of createKeep, but the SetKeep command will change the keep for a particular file.
If a pattern does not include a version number specification, then !H is appended.
If a pattern which matches a subtree (files in subdirectories) is used, the subdirectory structure will be lost.
It is likely that Copy remote-pattern!* does not do what you think!
% Copy /Ivy/Stewart/temp/W1aw.txt!*
///wierd/w1aw.txt ← [Ivy]<Stewart>temp>w1aw.txt!1
///wierd/w1aw.txt ← [Ivy]<Stewart>temp>w1aw.txt!2
///wierd/w1aw.txt ← [Ivy]<Stewart>temp>w1aw.txt!3
% list -bof w1aw.txt
[]<>wierd>w1aw.txt!2 []<>wierd>w1aw.txt!3
The attachments were made in the order shown, but the default keep = 2 has causes w1aw.txt!1 to fall off the edge. There is no guarantee that the local w1aw.txt!2 is the same as the remote w1aw.txt!2, as can be seen by the following example:
% Copy /Ivy/Stewart/temp/W1aw.txt!*
///wierd/w1aw.txt ← [ivy]<Stewart>temp>w1aw.txt!1
///wierd/w1aw.txt ← [ivy]<Stewart>temp>w1aw.txt!2
///wierd/w1aw.txt ← [ivy]<Stewart>temp>w1aw.txt!3
% list w1aw.txt
[]<>wierd>w1aw.txt!5 []<>wierd>w1aw.txt!6
CreateButton buttonName {*}
The command appends a button to the herald of the CommandTool in which it is run. The name of the button is given by buttonName. When the button is clicked, the remainder of the command line is transformed as described below and stuffed into the CommandTool input. Before stuffing, the button procedure checks to see whether or not the current input buffer of the CommandTool ends with a CR. If it does not, then the buffer is erased back to the last CR.
The button procedure appends a CR to the end of commandLine if there is not one there already.
Substitutions are done on commandLine before stuffing it. The following special strings are replaced as shown:
$CurrentSelection$ => replaced by the current selection up to but not including the first carriage return
$FileNameSelection$ => replaced by the current selection if it appears to be a file name, otherwise replaced by the name of the selected viewer
$ShortFileNameSelection$ => same as $FileNameSelection$ except that version number and directory are omitted
$SelectedViewerName$ => replaced by the name of the selected viewer
$ViewerPosition$ => replaced by the position of the current selection in a viewer
$MouseButton$ => "left" | "middle" | "right"
$ShiftKey$ => "shift" | "noShift"
$ControlKey$ => "control" | "noControl"
The idea is that one writes an ordinary command line CommandProc to do some job, then use CreateButton to hook up a button to it.
examples
% CreateButton Test // CurrentSelection = $CurrentSelection$, FileNameSelection = $FileNameSelection$, SelectedViewerName = $SelectedViewerName$, ViewerPosition = $ViewerPosition$, MouseButton = $MouseButton$, ShiftKey = $ShiftKey$, ControlKey = $ControlKey$
% -- Select something like "Atom" in the viewer CommandsCImpl.mesa and click control shift middle
% // CurrentSelection = Atom, FileNameSelection = Atom, SelectedViewerName = []<>ct>commandscimpl.mesa, ViewerPosition = 12, MouseButton = middle, ShiftKey = shift, ControlKey = control
Date
Prints date and time on standard output stream.
examples
% Date
Monday, April 22, 1985 7:02 pm PST
Delete (Del) {pattern}*
Delete deletes the FS files matching the given patterns. It does not ask for confirmation. Both local and remote patterns can be used. If there is no version number, the default is !L.
switches
X forces an exact level match for the pattern, so that the same number of directry separators must appear both in the matching files and the pattern
examples
% Delete /Ivy/Stewart/Temp/W1aw.txt!2
deleting /Ivy/Stewart/Temp/W1aw.txt!2

% Delete ///temp/*
deleting []<>temp>Binder.Log!1
deleting []<>temp>commands.txt!1
deleting []<>temp>foo.cm!1

% Delete ///temp/*
deleting []<>temp>commands.txt!2
warnings
Delete does not ask for confirmation.
Echo {*}
Echo parses its command line with CommandTool.Parse and prints the resulting tokens with separating spaces and a final carriage return. It is most useful to see what one of your command lines expands into. It is also useful for getting star patterns into a file.
examples
% Echo a b c
a b c
Eval (←) {*}
Eval calls the interpreter to evaluate and print the remainder of the command line (which is uninterpreted as far as the Command Tool is concerned).
examples
% Eval 1.2+3.4
4.6
Fail
This Commander.CommandProc merely returns [$Failure, "This Command Always Fails"]. This will terminate processing of further commands on the same line.
examples
% Date; Fail; Date
Monday, April 22, 1985 7:17 pm PST
This Command Always Fails
[[Command Failed]]
FindExcessVersions {pattern}*
FindExcessVersions finds excess versions of files that match the given patterns (* is the default). Excess versions are all versions other than the highest numbered version of a file.
examples
% FindExcessVersions
[]<>Cedar6.0>CommandToolCommands.tioga!5
. . .
FindR {pattern}*
FindR finds matching file names in the release. It is useful for finding a file name given partial information.
examples
% FindR CommandTool
CommandTool.* =>
[Cedar]<Cedar6.0>Top>CommandTool.df!23
April 22, 1985 8:16:10 pm PST
[Cedar]<Cedar6.0>CommandTool>CommandTool.mesa!2
March 5, 1985 5:11:50 pm PST
warnings
Starting a pattern with '* will cause the match to be extremely slow. In general, the more prefix given, the faster the search.
FlushCache {pattern}*
FlushCache deletes files from the FS local disk cache.
It can be used:
a) to force a retrieval of a certain file when next referenced.
b) to give advice to FS that a file or group of files will not be needed for a long time.
examples
% FlushCache [Ivy]<Stewart>CommandTool>*
flushing [Ivy]<Stewart>CommandTool>CompileCommandTool.cm!2
flushing [Ivy]<Stewart>CommandTool>FSFileCommandsImpl.bcd!4
. . .
Help (?, ??) {pattern}*
If pattern does not include a *, then a CommandTool.LookupCommand is done to find the command. This has some interesting consequences described in the warnings section!
If pattern is a directory name, then a * is appended -- ? directoryName will display all commands registered in a particular directory and its subdirectories.
If pattern is not a full path name, and includes a *, then a * is prepended. Thus ? lis* will behave like ? *Lis*.
examples
% ? Version Date
///Commands/Version Print Cedar version number
///Commands/Date Print date and time
% ? ve*
///Commands/FSBringover FSBringover list-of-remote-patterns
///Commands/Scavenge Scavenge {volumeName} -- FS scavenge
///Commands/Version Print Cedar version number
Indent {number}
Indent is a filter which reads the standard input and prints each line (delimited by CR) on the standard output after printing some number of spaces. The default argument is 8.
examples
% Date | Indent 10
November 1, 1983 7:20 pm
KillExcessVersions {pattern}*
FindExcessVersions finds excess versions of files that match the given patterns (* is the default). Excess versions are all versions other than the highest numbered version of a file. The K switch can be used to indicate that the following number is the number of versions to keep.
examples
% KillExcessVersions
deleting []<>Cedar5.3>Binder.df!1
. . .
% KillExcessVersions -K 2 *
deleting []<>Cedar5.3>Binder.df!1
. . .
List (LS) {switch | pattern}*
The list command prints names and possibly information about files in the FS directory system. It is a user interface for the FS.EnumerateForInfo and FS.EnumerateForNames calls.
List works for both local and remote patterns.
List works in the current working directory if a pattern is not a full path.
List works with both / and [ style filenames.
If a pattern given to List is a directory name, (ends with a '/ or '>) then a '* is appended.
Switches (case not important)
~ negates the sense of the following switch
A prints Attachments (← false)
B inhibits printing of size and create date (← false)
D sorts files by create Date (← no sort)
F forces Full file name printing (← false)
G forces Global file name printing (← false)
K prints Keep information (← false)
N forces Narrow printing (size and date on separate line) (← false)
O forces printing to One line where reasonable (← false)
P prints only Prefixes (directories) (← false)
R forces Remote checking (← false)
S sorts files by Size in bytes (← no sort)
U prints only Unattached files (← false)
X eXact level match (causes "*" to not match ">") (← false)
> causes sorting by most recent first for dates, largest first for sizes (default)
< causes sorting by least recent first for dates, smallest first for sizes
Switches can appear anywhere within a command line. Their effect is cumulative within the command.
List -U prints only those files which are not FS attachments and which consequently are not backed up anywhere. List -u ///* is a good way to get a list of all such files. List -u ///*!H is probably most helpful, since only the most recent files are of particular interest.
The user can tailor the default switches for List by the user profile. As an example, to default the F and R switches to true, use:
ListCommand.DefaultSwitches: fr
examples
% list ///Compiler.log
[]<>Compiler.log!212 237 11-Jul-84 20:39:07 PDT
-- 1 files, 237 total bytes
% list -f ///Compiler.*
[]<>Compiler.bcd!3 294400 16-May-84 19:47:10 PDT
[]<>Compiler.config!1 3064 25-Jan-84 12:49:23 PST
[]<>Compiler.df!6 17634 30-May-84 10:40:40 PDT
[]<>Compiler.load!2 78 21-Nov-83 14:55:08 PST
[]<>Compiler.log!212 237 11-Jul-84 20:39:07 PDT
-- 5 files, 315413 total bytes
% list -bfo ///Compiler.log
[]<>Compiler.bcd!3 []<>Compiler.config!1 []<>Compiler.df!7 []<>Compiler.load!2
-- 4 files
% list -n ///Compiler.* -d ///Compiler.*
[]<>
Compiler.bcd!3 294400 16-May-84 19:47:10 PDT
Compiler.config!1 3064 25-Jan-84 12:49:23 PST
Compiler.df!6 17634 30-May-84 10:40:40 PDT
Compiler.load!2 78 21-Nov-83 14:55:08 PST
Compiler.log!212 237 11-Jul-84 20:39:07 PDT
[]<>
Compiler.log!212 237 11-Jul-84 20:39:07 PDT
Compiler.df!6 17634 30-May-84 10:40:40 PDT
Compiler.bcd!3 294400 16-May-84 19:47:10 PDT
Compiler.config!1 3064 25-Jan-84 12:49:23 PST
Compiler.load!2 78 21-Nov-83 14:55:08 PST
-- 10 files, 630826 total bytes
ListBTree {pattern}*
ListBTree lists files in the FS cache. The first character of a line indicates the type of file (L means local, A means attached, C means cached). Local files print their names only, attached files prinnt both LName and GName. Cached files print their GNames and the time last used.
switches
A (attached) print files which are attachments but which are not cached locally
C (cached) print files which are attachments and which are cached locally
L (local) print files which are local (not-backed up)
The default switches are C and L because those are precisely the files which occupy space on the local disk.
examples
% ListBTree [Ivy]*
[Ivy]<CedarViewers>Viewers>Standard.icons!6
used at November 4, 1983 1:16 pm
[Ivy]<Stewart>Cedar>bugs.txt!1
used at November 2, 1983 5:32 pm
. . .
Load {file}*
Load causes programs to be loaded without being started. The Start command can then be used to start the programs (perhaps after breakpoints have been set).
examples
% Load Binder
Loaded: Binder, from: [Cedar]<Cedar6.0>Binder>Binder.bcd!5
Lookup {name}
Lookup performs the command lookup algorithm without actually executing the command if one is found. This is useful for testing the meaning of a command name before its execution would have bad side effects.
examples
% Lookup Lookup
Found: ///Commands/Lookup
Open {pattern}*
Open tioga viewer(s) on file(s) or create an empty tioga viewer. Patterns with *'s will open all matching files. If a version number is not explicit, !H will be used.
examples
% Open CommandTool
Opened: CommandTool
OpenR {pattern}*
OpenR opens Tioga viewers on matching files in the release. It will try to only open the most recent version if more than one is present, and will try to open the file with the "best" suffix if more than one name is matched.
examples
% OpenR CommandTool
Created Viewer: []<>Cedar6.0>Bogus.cm
PrintDebugSearchRules
The symbol table machinery, in particular, the interface AMFiles, maintains a list of directories in which to look for symbols and source files. This command prints that list.
Related commands are AddDebugSearchRules and SetDebugSearchRules.
examples
% PrintDebugSearchRules
( /// ///ct/ )
PseudoServerAdd (PSAdd) {name}*
PseudoServerAdd adds a pseudo-server translation to FS. This can cause a server name to denote one or several other actual servers. The meaning of the names is position sensitive, as in:
PSAdd server writeServer readServer ...
There can only be one write server, but there can be multiple read servers. The R switch can be specified after the server name to denote that the files accessed through this server name are to be treated as replicated (when a file is absent on one readServer, the others are not searched). If no writeServer or readServer is specified, any current translation for the name is deleted.
examples
% PSAdd Cedar -r Indigo Indigo Cyan
'Cedar' updated in pseudo server list
% PSAdd Cedar
'Cedar' deleted from pseudo server list.
PseudoServerPrint (PSPrint)
PseudoServerPrint prints the current pseudo-server translations.
examples
% PseudoServerPrint
Cedar -r Indigo Indigo Cyan
User Ivy Ivy
RemoveButton buttonName
The command removes a button from the menu of the CommandTool in which it is run. The name of the button is buttonName.
examples
% CreateButton Test Echo Test
(creates a button labelled "Test")
% RemoveButton Test
(removes the button labelled "Test")
Rename {pattern}*
Rename renames files using FS.Rename, and has interpretes its arguments as the Copy command does. If full path names are not used, FS will operate on files in the current working directory. If a pattern does not include a version number specification, then !H is appended.
examples
% rename bar ← junk.txt
% rename bar.txt ← [ivy]<Stewart>temp>w1aw.txt
% rename /Ivy/Stewart/Temp/Compiler.log ← Compiler.log
% rename /Ivy/Stewart/Notes/Compiler.log ← /Ivy/Stewart/Temp/Compiler.log
% rename /Ivy/Stewart/Temp/*
Moves all files in /Ivy/Stewart/Temp/ to the current working directory.
% rename ///Temp/ ← /Ivy/Stewart/Temp/*
Moves all files in /Ivy/Stewart/Temp/ to ///Temp/.
Rollback
Rollback to previous a checkpoint. This is a simple interface to Booting.Boot and is otherwise the same as the procedure called by the Rollback button in the herald.
Run {file}*
Loads and starts a BCD unless it is already loaded. You may omit the extension if it is ".bcd".
switches
A Always runs the file, even if it has been run before
D Don't start the bcd if it has unbound imports
warnings
You will find out about version mismatches etc. If there are any errors other than unbound imports, the module or configuration will not be STARTed. If there were unbound imports, the BCD will be STARTed unless the -d switch is set.
Scavenge {volumeName}
Scavenge invokes FSBackdoor.ScavengeDirectoryAndCache on the named volume (the current volume is the default).
warnings
This command takes a long time, and should not normally be necessary.
SetDebugSearchRules {directory}*
The symbol table machinery, in particular, the interface AMFiles, maintains a list of directories in which to look for symbols and source files. This command changes that list by deleting the old one and installing each of the directories on the command line.
Related commands are AddDebugSearchRules and PrintDebugSearchRules.
examples
% SetDebugSearchRules ///Junk/ ///Acme/
% PrintDebugSearchRules
( ///Junk/ ///Acme/ /// )
warnings
SetDebugSearchRules does not make many consistancy checks on directory names.
SetFreeboard number
Set the FS cache freeboard parameter (nPages should be a positive integer). This command is an interface to FSBackdoor.SetFreeboard.
examples
% SetFreeboard 1100
% PrintFSCacheInfo
size = 27999, free = 1501, freeboard = 1100
warnings
SetFreeboard to a large value may not work properly.
SetKeep number {pattern}*
Set the FS keep parameter of local files (number should be a positive integer). SetKeep will actually delete on the spot any versions of the file which are not in use and which would not be retained given the new value of keep. A keep value of 0 leaves the current keep alone, but does the keep processing of deleting any versions that are not in use and which are inconsistant with the existing keep value. SetKeep doesn't work for remote files (they have no FS keep property).
examples
% SetKeep 2 /ivy/stewart/temp/w1aw.txt
... FS.Error[Can't set the keep on a GName.]
% SetKeep 2 Test3.cm
SetSearchRules {directory}*
Set the CommandTool search rules. The arguments should be names of directories. SetSearchRules will append a '/ (or '> as appropriate) to any directory name that does not already have one.
examples
% SetSearchRules ///Commands/ ///Wierd/
% PrintSearchRules
( ///Commands/ ///Wierd/ )
warnings
SetSearchRules makes only brief checks that its arguments are really directories. SetSearchRules rejects any directory name shorter than three characters because /// is the shortest directory name and it rejects any name that does not start with '/ or '[.
ShiftInterp (Shift) {*}
Execute the remainder of the command line using CommandTool.DoCommand. Shift is an uninterpreted command while ShiftInterp is interpreted. You can user ShiftInterp to run a normally uninterpreted command in interpreted mode, getting IO redirection etc.
examples
% Shift Echo a b c
% Echo a b c
a b c
warnings
Be careful that the command line syntax interpreted by the command tool does not conflict with that required by an uninterpreted command.
There is no way to get a normally interpreted command to run uninterpreted.
Sleep number
Pause for number seconds (number < LAST[CARDINAL], using Process.Pause.
examples
% Sleep 5
Source {*}
With no arguments, this command creates a new, independent, command tool.
With arguments, takes the first argument as the name of a command file (searched for according to the search rules), and passes the remaining arguments to the command as $1$, $2$, $3$, and so forth.
The source command does not copy the process and command tool property lists, so that commands run from a "source" can change the properties seen by the command tool which invoked the source. A ChangeWorkingDirectory in a command file run with "Cmd" does not persist, but a ChangeWorkingDirectory in a command file run with "Source" holds its effects.
examples
Suppose the file Test1.cm contains "Date\nCommander Test2.cm\n" and Test2.cm contains "User\n":
% Command Test1
> Date
Monday, April 22, 1985 7:50 pm PST
> Command Test2.cm
>> User
Atkinson.pa
warnings
There are doubtless many bugs. A careful reading of CommandToolDoc.tioga will answer many questions.
Don't type Command&, it doesn't do anything useful. Actually, it directs the error streams to the new window that gets created, which isn't that useful.
Suppose the file Test3.cm contains "Command Test3.cm\n":
% Command Test3.cm
> Command Test3.cm
>> Command Test3.cm
>>> Command Test3.cm
>>>> Command Test3.cm
>>>>> Command Test3.cm
>>>>>> Command Test3.cm
...Aborted
Statistics {on | off}
Governs statistics printing. When statistics are on, every command prints running time, number of words allocated, and page faults.
examples
% Statistics on
% Date
Monday, April 22, 1985 7:52 pm PST
{0.01 seconds, 80 words}
% Statistics off
% Date
Monday, April 22, 1985 7:52 pm PST
warnings
Statistics do not behave sensibly with commands started with & or pipes.
Tee fileName
Tee is a filter which copies the standard input to a file and to the standard output. It can be used to obtain a log copy of the activities of some command.
examples
% List -u * | Tee UnbackedUpFiles.txt
. . .
warnings
Tee catches ViewerIO.Rubout, so if it is started reading from the keyboard, a DEL will stop it. It catches IO.Error, so an unexpectedly closed stream will not break it.
Time commandLine
Print the execution time of a command. Time uses CommandTool.DoCommand to "run" its arguments as a command line, then prints how long it took.
examples
% time Date
Monday, April 22, 1985 7:54 pm PST
Running time: 00:00:00.069088
Type {pattern}*
Type prints the contents of one or more files on the standard output. fileName (in executive window).
Because standard streams are used to read from the file, Tioga formatting and comment nodes disappear.
examples
% type test.cm
-- test.cm
///Commands/echo sleeping now
///Commands/sleep 1
///Commands/echo done sleeping
Unregister name
Unregister a command, so that it can no longer be invoked.
examples
% Unregister Alias
Unregister: Alias not found
% Unregister ///Commands/Alias
% Alias
[[Alias . . . not found]]
warnings
Unregister just sets the proc field of the stored record to NIL, so that clients of Commander.Lookup must be careful to check that the proc field of the CommandProcHandles returned by Lookup are not NIL.
Someday, this command may merely rename these to-be-deleted commands into another "directory" from which they can be retrieved.
User
Print name of logged in user on standard output stream.
examples
% User
Atkinson.pa
Version
Print Cedar version number and creation date on standard output stream.
examples
% Version
Cedar 6.0 of April 4, 1985 11:46:16 am PST
Working directory commands
The working directory commands are grouped together to facilitate understanding their interactions.
ChangeWorkingDirectory (CD CDR) {directory}
ChangeWorkingDirectory sets the $WorkingDirectory property of the process properties list. FS uses this property whenever no explicit working directory is passed to an FS procedure. ChangeWorkingDirectory clears the "stack" that Push and Pop use. CDR is similar to CD, except that it interpretes the directory specification relative to the root directory.
PrintWorkingDirectory (PWD)
PrintWorkingDirectory prints the current working directory.
PushWorkingDirectory (Push PushR) {directory}
Push sets the working directory and saves the previous working directory on a stack (implemented as the $WorkingDirectoryStack property). PushR is the same, except that it pushes relative to the root directory.
PopWorkingDirectory (Pop)
Pop restores the working directory from the stack. If the stack was empty, Pop does nothing.
All these commands rewrite the herald of the CommandTool viewer if there is one.
CD and Push will accept relative path names as well as full path names. For example, .. refers to the parent of the current working directory.
examples
Suppose you want to switch directories to work on the Bustle program.
% cd ///Projects/Bustle/
% pwd
///Projects/Bustle/
Suppose you want to browse for a while in the Cedar documentation, but then wish to return.
% PrintWorkingDirectory
///Projects/Bustle/
% Push [Indigo]<Cedar>Documentation>
% Open DFIncludes.txt
Created Viewer: [Indigo]<Cedar>Documentation>DFIncludes.txt
. . .

% Pop
% PrintWorkingDirectory
///Projects/Bustle/
Here are some examples of the kinds of names that work:
% cd ///
% cd []<>
Both slash and bracket format names work.
% pwd
% ///Projects/Bustle/
% cd temp/foo
Relative change to the directory ///Projects/Bustle/temp/foo/.
% cd ../..
Change the working directory back to ///Projects/Bustle/, which is the grandparent of ///Projects/Bustle/temp/foo/.
% cd ../bar/.
Change the working directory to be bar/, which is a subdirectory of the parent directory of the present working directory.
warnings
CD (and Push) do not make many checks on the reasonableness of the directoryName parameter:
% cd #~#~#~#
%
PrintWorkingDirectory calls CommandTool.CurrentWorkingDirectory[] which has a couple of side effects besides just returning the property value. If the working directory property doesn't exist, CurrentWorkingDirectory sets it to the same as the default working directory. CurrentWorkingDirectory also converts the working directory name to slash format and appends a '/ if the last character is not '/.