Prev | Current Page 188 | Next

Christopher Negus

"Linux Bible, 2008 Edition: Boot up to Ubuntu, Fedora, KNOPPIX, Debian, openSUSE, and 11 Other Distributions"

com to the end of a
command line. Then, for example, a mail message is sent to the user you choose after the command
completes.
Background Commands
Some commands can take a while to complete. Sometimes you may not want to tie up your shell
waiting for a command to finish. In those cases, you can have the commands run in the background
by using the ampersand (&).
Text formatting commands (such as nroff and troff, described earlier) are examples of commands
that are often run in the background to format a large document. You also might want to
create your own shell scripts that run in the background to check continuously for certain events
to occur, such as the hard disk filling up or particular users logging in.
Here is an example of a command being run in the background:
$ troff -me verylargedocument | lpr &
Other ways to manage background and foreground processes are described in the section
???Managing Background and Foreground Processes??? later in this chapter.
Expanding Commands
With command substitution, you can have the output of a command interpreted by the shell
instead of by the command itself. In this way, you can have the standard output of a command
become an argument for another command. The two forms of command substitution are
$(command) and `command` (backticks, not single quotes).


Pages:
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200