|
||
|
Lesson 2
Objective
|
Defining embedded execution Explain how embedded command execution works. |
|
|
The shell will perform embedded execution on any section of a command that is surrounded by back quotes. Embedded execution uses the
output of the embedded command as part of the text of a surrounding command. Here is an example command using embedded execution:
var1=`ls`
Notice that this differs from redirection, where the output of one command is used as the input to another command. Redirection can be
used to capture command output in a file, as in:
ls > file1
The ls command is run first and the output is assigned to the file named file1. Notice that with redirection, your command is
processed once. With embedded command execution, your command goes through a two-step process.
|
||
|
|
||