DCOM 142 EXAM TEST PAPER 2025 QUESTIONS WITH
ANSWERS RATED A+
✔✔The option used to create a tarball isÉ - ✔✔-c
✔✔The option used to test a tarball isÉ - ✔✔-t
✔✔What metacharacter will the shell interpret as a variable substitution? - ✔✔$
✔✔This data type or entity is used to store multiple values into a single entity? -
✔✔array
✔✔Mostly set by OS on login or when a shell is first invoked, this data typreor entity
value changes from time to time is called? - ✔✔variable
✔✔This is the correct way to assign a variable in Bash scripting. My_name=='John' -
✔✔false
✔✔File extensions are mostly optional in Linux. - ✔✔true
✔✔What represents the value that a child process passes back to its parent process
when the child process terminates? - ✔✔$?
✔✔Arrays start with the index 1 - ✔✔false
✔✔This line should placed at the beginning of all Bash scripts, generally on line 1. -
✔✔#!/bin/bash
✔✔What metacharacter will the shell interpret as a variable assignment? - ✔✔=
✔✔You wish to run a few commands with modified environment variables but only for
that particular session. No arguments will be used. Which command will you use? -
✔✔printenv
✔✔In BASH scripting, a blocks of code that you can reuse to perform specific tasks is
called? - ✔✔function
✔✔What metacharacter will the shell interpret as wildcard matching of 1 characters? -
✔✔?
✔✔Conditional statement which contains conditions to be evaluated and actions to
perform if true. - ✔✔if statement
, ✔✔Use a case statement to evaluate a variable. Which example will evaluate at least
two conditions of the variable and execute a command? - ✔✔case $var in condition1 )
execute ;; condition2 ) execute ;; condition3 ) execute ;; esac
✔✔Select all the parts of a for loop. - ✔✔for
do
done
✔✔What is use to implement logic into a Bash script? - ✔✔control statement
✔✔The line of code, taxtotal=10*$subtotal, is written in a script called taxes.sh. What
conditional statement is written afterward so that if the tax total is greater than 100, the
user will qualify for a bonus? - ✔✔"if [ $taxtotal -gt 100 ] then echo ""Your $taxtotal will
qualify you for a bonus!"" fi"
✔✔Select all the parts of an If statement. - ✔✔if
then
else
✔✔Control statement that enables you to repeat instructions while conditions are not
met. - ✔✔until loop
✔✔Control statement that executes code a specified number of times. - ✔✔for loop
✔✔Conditional statement to simplify complex conditionals when you have multiple
different choices. - ✔✔case statement
✔✔Your current bash script uses an if statement. If the condition is satisfied, an action
will be performed. You wish to incorporate a second action if the condition is not
satisfied. Which statement will you add to your code? - ✔✔else
✔✔You created a basic bash script called dailyscript.sh and saved it to the
/usr/local/bin/ directory. How would you execute the script using its absolute path? -
✔✔/usr/local/bin/dailyscript.sh
✔✔MyScript.sh 55 6 2. Which commands will pass-through any of the arguments
initiated with the script? (Select two) - ✔✔$totaltax = ($1 * .10)
$variable1 = $3
✔✔Control statement that enables you to repeat instructions while conditions are met. -
✔✔while loop
ANSWERS RATED A+
✔✔The option used to create a tarball isÉ - ✔✔-c
✔✔The option used to test a tarball isÉ - ✔✔-t
✔✔What metacharacter will the shell interpret as a variable substitution? - ✔✔$
✔✔This data type or entity is used to store multiple values into a single entity? -
✔✔array
✔✔Mostly set by OS on login or when a shell is first invoked, this data typreor entity
value changes from time to time is called? - ✔✔variable
✔✔This is the correct way to assign a variable in Bash scripting. My_name=='John' -
✔✔false
✔✔File extensions are mostly optional in Linux. - ✔✔true
✔✔What represents the value that a child process passes back to its parent process
when the child process terminates? - ✔✔$?
✔✔Arrays start with the index 1 - ✔✔false
✔✔This line should placed at the beginning of all Bash scripts, generally on line 1. -
✔✔#!/bin/bash
✔✔What metacharacter will the shell interpret as a variable assignment? - ✔✔=
✔✔You wish to run a few commands with modified environment variables but only for
that particular session. No arguments will be used. Which command will you use? -
✔✔printenv
✔✔In BASH scripting, a blocks of code that you can reuse to perform specific tasks is
called? - ✔✔function
✔✔What metacharacter will the shell interpret as wildcard matching of 1 characters? -
✔✔?
✔✔Conditional statement which contains conditions to be evaluated and actions to
perform if true. - ✔✔if statement
, ✔✔Use a case statement to evaluate a variable. Which example will evaluate at least
two conditions of the variable and execute a command? - ✔✔case $var in condition1 )
execute ;; condition2 ) execute ;; condition3 ) execute ;; esac
✔✔Select all the parts of a for loop. - ✔✔for
do
done
✔✔What is use to implement logic into a Bash script? - ✔✔control statement
✔✔The line of code, taxtotal=10*$subtotal, is written in a script called taxes.sh. What
conditional statement is written afterward so that if the tax total is greater than 100, the
user will qualify for a bonus? - ✔✔"if [ $taxtotal -gt 100 ] then echo ""Your $taxtotal will
qualify you for a bonus!"" fi"
✔✔Select all the parts of an If statement. - ✔✔if
then
else
✔✔Control statement that enables you to repeat instructions while conditions are not
met. - ✔✔until loop
✔✔Control statement that executes code a specified number of times. - ✔✔for loop
✔✔Conditional statement to simplify complex conditionals when you have multiple
different choices. - ✔✔case statement
✔✔Your current bash script uses an if statement. If the condition is satisfied, an action
will be performed. You wish to incorporate a second action if the condition is not
satisfied. Which statement will you add to your code? - ✔✔else
✔✔You created a basic bash script called dailyscript.sh and saved it to the
/usr/local/bin/ directory. How would you execute the script using its absolute path? -
✔✔/usr/local/bin/dailyscript.sh
✔✔MyScript.sh 55 6 2. Which commands will pass-through any of the arguments
initiated with the script? (Select two) - ✔✔$totaltax = ($1 * .10)
$variable1 = $3
✔✔Control statement that enables you to repeat instructions while conditions are met. -
✔✔while loop