Suppose that your login shell is a TC shell. You received a shell script that runs under Bourne Again shell. How would you executed it? Clearly write down all the steps that you would use.
What will be an ideal response?
Let’s assume that the Bourne Again shell (Bash) script is in a file called my_script. In order to execute the script in this file, I will take the following four steps.
1.Make the script executable by executing the chmod u+x my_script command. (See Chapter 5 for file permissions.)
2.Start a Bash process on top of my login TC shell by running the bash (or /bin/bash) command.
3.Execute the shell script by running the my_script as a command.
4.Terminate the Bourne shell process and get back to my login TC shell.
The following shell session show the four steps.
% chmod u+x my_script
% /bin/bash
$ my_script
[ Output of the script ]
$
%
Another way to execute the shell script is to make it executable, put #!/bin/bash on the first line of the my_script file, make it executable by
using the chmod u+x my_script command, and execute the script.
You might also like to view...
Gridlines and Guides are options on the ________ tab
Fill in the blank(s) with correct word
Which of the following is considered one of the limitations of data mining as a popular analysis tool?
a. Data mining is incapable of revealing patterns. b. Data mining's tools of analysis are limited to statistical models, mathematical algorithms, and artificial intelligence. c. Data mining is employed to enhance services, not analyze intelligence and identify terrorists. d. Data mining doesn't identify causal relationships or strength of connections.