Distributed Networks Home
DBWebApplications eWebProgrammer
prev next prev next
  Course navigation
 
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`
The back quoted command--the ls--is run first and the output is assigned to the var1 variable. The difference between embedded execution and redirection
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 two-step process of embedded execution
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.
  Course navigation