What are two ways you can execute a shell script when you do not have execute permission for the file containing the script? Can you execute a shell script if you do not have read permission for the file containing the script?
What will be an ideal response?
You can give the name of the file containing the script as an argument to
the shell (for example, bash scriptfile or tcsh scriptfile, where scriptfile is
the name of the file containing the script).
Under bash you can give the following command:
$ . scriptfile
Under both bash and tcsh you can use this command:
$ 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.
You might also like to view...
Case-Based Critical Thinking QuestionsCase 2 In his database of thousands of records, Suresh wants to standardize the format of certain fields. However, he does not want to store the formatting characters (e.g., parentheses, dashes, and slash characters). He decides to consult Sheila because she has extensive experience with input masks. Sheila tells Suresh that there is an input mask character that causes the input mask to display from right to left. Also, characters typed into the mask always fill from left to right. What is this character?
A. ! B. > C. R D. 0
What does show(p) do?
If p is defined as a variable, then Python will print to the console the value of p. If p has no value, Python will print out:
Satellite service speeds are comparable to those for ________ subscriber lines
Fill in the blank(s) with correct word
The if/then/else operation is a conditional statement.
Answer the following statement true (T) or false (F)