2024 / WGU - C851 - Chapter 11, Exam Questions and answers. Verified.
WGU - C851 - Chapter 11, Exam Questions and answers. Verified. For a shell script intended to be run by the Bash shell, what should you start the script with? - #!/bin/bash How do you add execute permissions to a file? - -chmod +x filename In a situation where you are launching multiple commands in a script, what can you add to the end of each command to allow the next command to run before the first finishes? - -& This utility provides text editor capabilities via commands that can be typed in a command prompt. - -sed You've written a script that accepts 2 arguments. In the script, what variables are these arguments assigned to? - -$1 and $2 When accessing a variable in a shell script, how should you type the variable name? - -With a $ at the beginning of it. $variableName When assigning a value to a variable in a shell script, how should you type the variable name? - -Just the variable name. When assigning, you don't need to put a $ in front of it. What variable holds the exit status of the most recently executed command? - -$? If the previous command succeeded, it should be 0. Logical AND - -written as && in the script both sides of the operator must be true for the condition to be true Logical OR - -written as || in the script either side of the operator can be true for the condition to be true What is the syntax for an IF statement? - -if [ condition ]
Written for
- Institution
- Western Governors University
- Course
- WGU - C851
Document information
- Uploaded on
- October 23, 2023
- Number of pages
- 5
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
wgu c851 chapter 11 exam questions and answe