Difference between revisions of "Compound commands"

From Sugar Labs
Jump to navigation Jump to search
(Created page with "A compound command is a list of commands that are tied together so that they work as one.")
 
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
A compound command is a list of commands that are tied together so that they work as one.
 
A compound command is a list of commands that are tied together so that they work as one.
 +
 +
For example:
 +
date && \
 +
echo success
 +
 +
The ''date'' command is run, then if it works the ''echo'' command is run.  If the ''date'' command were to fail, the ''echo'' command would not be run.  For deep technical detail, see the BASH manual.
 +
 +
== Copy and Paste ==
 +
 +
[[Image:Compound-command-example.png|thumb|Where to press, move, and release]]
 +
 +
How to copy and paste a compound command.
 +
 +
Move the cursor above the first line, press and hold the mouse button, move the cursor below below the last line, then release the mouse button.
 +
 +
Look at the image.  The green dot is where the mouse button should be pressed, and the red dot is where it should be released.  Notice how the text has been highlighted.  This shows the area that will be copied.
 +
 +
Next, use Copy in the web browser, and Paste in the Terminal.  (The web browser keyboard shortcut for Copy is Ctrl/C, and the Terminal keyboard shortcut is Ctrl/Shift/V.  Usually.)
 +
 +
The command will be run as soon as it is pasted.

Latest revision as of 00:25, 9 March 2012

A compound command is a list of commands that are tied together so that they work as one.

For example:

date && \
echo success

The date command is run, then if it works the echo command is run. If the date command were to fail, the echo command would not be run. For deep technical detail, see the BASH manual.

Copy and Paste

Where to press, move, and release

How to copy and paste a compound command.

Move the cursor above the first line, press and hold the mouse button, move the cursor below below the last line, then release the mouse button.

Look at the image. The green dot is where the mouse button should be pressed, and the red dot is where it should be released. Notice how the text has been highlighted. This shows the area that will be copied.

Next, use Copy in the web browser, and Paste in the Terminal. (The web browser keyboard shortcut for Copy is Ctrl/C, and the Terminal keyboard shortcut is Ctrl/Shift/V. Usually.)

The command will be run as soon as it is pasted.