OpenWindows Advanced User's Guide

2.2.2 Entering Multiple Commands and Long Commands

You can enter more than one command on a single line. Simply place a semicolon (;) between the commands, as shown here with the date command and the logname command:

$ date; logname
Mon Feb 3 10:19:25 PST 1992
spanky
$

As you can see, this displays the current date and time (from the date command) and the login name of the user currently logged in to the system (from the logname command).

If you are typing a very long command, you can use the backslash character (\) to continue typing on a second line. For example:

$ date; \
logname
Mon Feb 3 10:23:25 PST 1992
hankw
$

Even though the date and logname commands are by no means long commands, they are used in this example to demonstrate the concept of continuing a set of commands on the next line in as simple a manner as possible. Later, when the commands you want to use are longer than the width of your screen, you'll see how using the backslash character can be extremely useful.


Note -

If you are using the Shell Tool or Command Tool windows in the OpenWindows environment, you won`t need to use the backslash character to continue typing commands on the next line. When you reach the end of a line, the commands you're typing wrap to the next line automatically, and the system executes all commands when you press Return.