Both the Bourne shell and the C shell support multiline commands.
In the Bourne shell, a newline following an open quote (
In the C shell, you can continue a line by. You won't get the secondary prompt.
Obviously, this is a convenience if you're typing a long command line. It is a minor feature and one easily overlooked; however, it makes it much easier to use a program likefrom the command line. For example, if you know you chronically make the typos "mvoe" (for "move") and "thier" (for "their"), you might be inspired to type the following command:
More importantly, the ability to issue multiline
commands lets you use the shell's programming
features interactively from the command line.
In both the Bourne and the C shell, multiline programming constructs
automatically generate a secondary prompt (
For example, here's a place to use my favorite programming construct for non-programmers, the:
Or in the C shell with:
While a simple command like this could be saved into a, it is often even easier to use it interactively.
Users of sed should of course