RUNCOM

Last updated

RUNCOM is a CTSS macro command (script) processor. [1]

Contents

History

Louis Pouzin created RUNCOM for CTSS circa 1963. [2] He wrote a paper in 1965 describing a design for the Multics shell which includes a brief description of RUNCOM [3] followed by a second paper he wrote five days later describing a design for RUNCOM that added commands for control flow, conditional branching and looping. [4]

In the context of Unix-like systems, the term rc stands for the phrase "run commands". It is used for any file that contains startup information for a command.

From Brian Kernighan and Dennis Ritchie: [5]

There was a facility that would execute a bunch of commands stored in a file; it was called runcom for "run commands", and the file began to be called "a runcom". rc in Unix is a fossil from that usage.

Tom Van Vleck, a Multics engineer, has also reminisced about the extension rc: "The idea of having the command processing shell be an ordinary slave program came from the Multics design, and a predecessor program on CTSS by Louis Pouzin called RUNCOM, the source of the '.rc' suffix on some Unix configuration files." [6]

This is also the origin of the name of the Plan 9 from Bell Labs shell by Tom Duff, the rc shell. It is called "rc" because the main job of a shell is to "run commands".

While not historically precise, rc may also be expanded as "run control", because an rc file controls how a program runs. For instance, the editor Vim looks for and reads the contents of the .vimrc file to determine its initial configuration. In The Art of Unix Programming , Eric S. Raymond consistently refers to rc files as "run-control" files.

Usage

Background

RUNCOM is not a shell in the sense of the UNIX shell. When a user type commands into CTSS they go to the supervisor (kernel), not any UNIX-shell-like program. Users cannot type commands into RUNCOM, it processes disk files. CTSS files have first name and a second name separated by spaces, e.g. FOO BCD.

Description of RUNCOM

RUNCOM command chains also known as macro-commands (both terms mean scripts) are files with a second name of either RUNCOM or BCD which contain zero or more lines. Lines in the script are either blank lines, comments, regular commands (the kind that could be entered on the supervisor's command line) or the pseudo-command (command built into RUNCOM only) CHAIN.

Comments start with either $ or * as the first character of the line. Comments using $ are printed (including the $) when RUNCOM runs while ones with * are not printed at all. Parameter substitution does not occur in comments.

When a user invoke RUNCOM, the arguments (parameters) to it must first start with the first name of the file containing the script. If a user invoke RUNCOM without any arguments it prints some instructions on how to use it and stops, returning the user to the supervisor's (system's) command line. The remaining arguments, if any, are either command names, values to be used as arguments in the script or the strings (NIL) or (END) including the parenthesis.

In the script, CHAIN give names to arguments which were used on the command line when RUNCOM was called, e.g. putting CHAIN LALA FAFA in the script and invoking RUNCOM XYZZY 3 will cause LALA in the script to be substituted into a 3 when it is used in any lines that come after CHAIN while FAFA will remain FAFA as RUNCOM was invoked without specifying anything for it.

If an argument to RUNCOM is (NIL), a positional parameter denoted as an argument to CHAIN in the script will be expand into nothing, e.g. CHAIN ALPHA BETA GAMMA combined with RUNCOM A (NIL) B will cause ALPHA to be substituted with A and GAMMA to B while BETA will be removed from any command that follows CHAIN in the script.

If a RUNCOM argument is (END) the corresponding CHAIN argument will be treated as (NIL) and all subsequent arguments will also be treated as (NIL).

Any parameter to CHAIN can be used as a command name in the script, i.e. can come first before any arguments. An example would be RUNCOM SCRIPT LISTF combined with CHAIN CMD followed by CMD at the start of a following line. CMD will be substituted into LISTF which will list the files in the directory (like the Unix ls command).

Once the substitutions have been completed, RUNCOM sends the commands to the SCHAIN library subroutine which is available to other programs as well. [1]

See also

Related Research Articles

<span class="mw-page-title-main">Multics</span> Time-sharing operating system

Multics is an influential early time-sharing operating system based on the concept of a single-level memory. Nathan Gregory writes that Multics "has influenced all modern operating systems since, from microcomputers to mainframes."

<span class="mw-page-title-main">Unix shell</span> Command-line interpreter for Unix operating system

A Unix shell is a command-line interpreter or shell that provides a command line user interface for Unix-like operating systems. The shell is both an interactive command language and a scripting language, and is used by the operating system to control the execution of the system using shell scripts.

<span class="mw-page-title-main">Bourne shell</span> Command-line interpreter for operating systems

The Bourne shell (sh) is a shell command-line interpreter for computer operating systems.

In software development, Make is a build automation tool that builds executable programs and libraries from source code by reading files called makefiles which specify how to derive the target program. Though integrated development environments and language-specific compiler features can also be used to manage a build process, Make remains widely used, especially in Unix and Unix-like operating systems.

<span class="mw-page-title-main">Compatible Time-Sharing System</span> Computer operating system

The Compatible Time-Sharing System (CTSS) was the first general purpose time-sharing operating system. Compatible Time Sharing referred to time sharing which was compatible with batch processing; it could offer both time sharing and batch processing concurrently.

An environment variable is a user-definable value that can affect the way running processes will behave on a computer. Environment variables are part of the environment in which a process runs. For example, a running process can query the value of the TEMP environment variable to discover a suitable location to store temporary files, or the HOME or USERPROFILE variable to find the directory structure owned by the user running the process.

The Control Language (CL) is a scripting language originally created by IBM for the System/38 Control Program Facility and later used in OS/400. It bears a resemblance to the IBM Job Control Language and consists of a set of command objects (*CMD) used to invoke traditional programs or get help on what those programs do. CL can also be used to create CL programs where there are additional commands that provide program-like functionality

In computing, echo is a command that outputs the strings that are passed to it as arguments. It is a command available in various operating system shells and typically used in shell scripts and batch files to output status text to the screen or a computer file, or as a source part of a pipeline.

Command-line completion is a common feature of command-line interpreters, in which the program automatically fills in partially typed commands.

<span class="mw-page-title-main">Comparison of command shells</span>

A command shell is a command-line interface to interact with and manipulate a computer's operating system.

<span class="mw-page-title-main">Shell (computing)</span> Computer program that exposes an operating systems services to a human user or other programs

In computing, a shell is a computer program that exposes an operating system's services to a human user or other programs. In general, operating system shells use either a command-line interface (CLI) or graphical user interface (GUI), depending on a computer's role and particular operation. It is named a shell because it is the outermost layer around the operating system.

<span class="mw-page-title-main">Louis Pouzin</span> French computer scientist (born 1931)

Louis Pouzin is a French computer scientist. He designed a pioneering packet communications network, CYCLADES that was the first to implement the end-to-end principle, which became fundamental to the design of the Internet.

alias (command) Command in various command line interpreters

In computing, alias is a command in various command-line interpreters (shells), which enables a replacement of a word by another string. It is mainly used for abbreviating a system command, or for adding default arguments to a regularly used command. alias is available in Unix shells, AmigaDOS, 4DOS/4NT, KolibriOS, Windows PowerShell, ReactOS, and the EFI shell. Aliasing functionality in the MS-DOS and Microsoft Windows operating systems is provided by the DOSKey command-line utility.

In computing, a shebang is the character sequence consisting of the characters number sign and exclamation mark at the beginning of a script. It is also called sharp-exclamation, sha-bang, hashbang, pound-bang, or hash-pling.

A batch file is a script file in DOS, OS/2 and Microsoft Windows. It consists of a series of commands to be executed by the command-line interpreter, stored in a plain text file. A batch file may contain any command the interpreter accepts interactively and use constructs that enable conditional branching and looping within the batch file, such as IF, FOR, and GOTO labels. The term "batch" is from batch processing, meaning "non-interactive execution", though a batch file might not process a batch of multiple data.

help (command) Command in various command line shells

In computing, help is a command in various command line shells such as COMMAND.COM, cmd.exe, Bash, qshell, 4DOS/4NT, Windows PowerShell, Singularity shell, Python, MATLAB and GNU Octave. It provides online information about available commands and the shell environment.

<span class="mw-page-title-main">Scripting language</span> Programming language for run-time events

A scripting language or script language is a programming language that is used to manipulate, customize, and automate the facilities of an existing system. Scripting languages are usually interpreted at runtime rather than compiled.

In computing, command substitution is a facility that allows a command to be run and its output to be pasted back on the command line as arguments to another command. Command substitution first appeared in the Bourne shell, introduced with Version 7 Unix in 1979, and has remained a characteristic of all later Unix shells. The feature has since been adopted in other programming languages as well, including Perl, PHP, Ruby and Microsoft's Powershell under Windows. It also appears in Microsoft's CMD.EXE in the FOR command and the ( ) command.

<span class="mw-page-title-main">Command-line interface</span> Computer interface that uses text

A command-line interface (CLI) is a means of interacting with a device or computer program with commands from a user or client, and responses from the device or program, in the form of lines of text. Such access was first provided by computer terminals starting in the mid-1960s. This provided an interactive environment not available with punched cards or other input methods.

Glenda Schroeder is an American software engineer noted for implementing the first command-line user interface shell and publishing one of the earliest research papers describing electronic mail systems while working as a member of the staff at the MIT Computation Center in 1965.

References

  1. 1 2 Grisman, P.A., ed. (1969). The Compatible Time-Sharing System - A Programmer's Guide, 2nd Ed. Boston: The MIT Press. p. 525.
  2. Pouzin, Louis (25 November 2000). "The Origin of the Shell". Multicians. Retrieved 31 July 2017.
  3. Pouzin, Louis (April 2, 1965). The SHELL: A Global Tool for Calling and Chaining Procedures in the System (PDF) (Report). Massachusetts Project Institute of Technology Project MAC. MDN-4. Retrieved April 9, 2022.
  4. Pouzin, Louis (April 7, 1965). RUNCOM - A Macro-Procedure Processor for the 636 System (PDF) (Report). Massachusetts Project Institute of Technology Project MAC. MDN-4. Retrieved April 9, 2022.
  5. "In Unix, what do some obscurely named commands stand for?". IT Knowledge Base. Indiana University . Retrieved 2009-04-20.
  6. "Unix and Multics" . Retrieved 2009-04-20.