The Shell Executes A Program When You Enter A Command In Response To Its Prompt

Submitted By eraul24
Words: 469
Pages: 2

Assignment 3

Chapter 7
1. The shell executes a program when you enter a command in response to its prompt. For example when you give the ls command the shell executes the utility program named ls. You can cause the shell to execute other types of programs such as shell scripts, application programs, and programs you have written in the same way. The line that contains the command including any arguments is called the command line. An option is argument that modifies the effects of a command. You can frequently specify more than one option modifying the command in several different ways. Options are specific to and interpreted by the program that the command line calls, not by the shell.

3. To run a command in the background type an ampersand just before the return that ends the command line. The shell assigns a small number to the job and displays this job number between brackets. Following the job number the shell displays the process identification number (PID) a larger number assigned by the operating system. Each of these numbers identifies the command running in the background. The shell the displays another prompt and you can enter another command. When the background job finishes the shell displays a message giving both the job number and the command line used to run the command.

Chapter 9
1.

2. You can give the name of the file containing the script as an argument to the shell (for example, bash scriptfile, where scriptfile is the name of the file containing the script).Under bash you can give either of the following commands:$ . scriptfile$ source scriptfile. Because the shell must read the commands from the file containing a shell script before it can execute the commands, you must have read permission for the file to execute a shell script.

5.

10. There are many ways to solve this