





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A series of practice questions and answers related to bash scripting and automation. It covers topics such as variable assignment, script execution, command usage, and git commands. The questions are designed to test understanding of key concepts and practical skills in scripting and automation, making it a valuable resource for students and professionals looking to enhance their knowledge in this area. It includes questions on topics such as orchestration, infrastructure as code (iac), and industry-standard management systems.
Typology: Exams
1 / 9
This page cannot be seen from the preview
Don't miss anything!






Scripting and Automation Chapter 14 Which of the following are valid ways to assign a variable a value in a bash script? (Select two.) - 1. variable1=Hello
Which of the following shell declarations should you enter on the first line of a script for a system that uses the Bash shell? - #!/bin/bash You can use the time command to determine how long a given command takes to run. The output of the time command displays three values. Which of the following are the time values displayed by the time command? (Select three.) - 1. system
Which of the following commands can you use to delete a variable? - unset You have created the following array in the statearray variable: declare -a statearray=(Nevada Utah California Arizona Texas) Which of the following commands will display the phrase Life elevated - Utah? - echo "Life elevated - $statearray[2]" Which of the following are required when creating a case construct? - 1. Close each case with two semi-colons.
Which of the following shows a possible output if the script is executed from Bill's home directory? - item: Desktop item: Documents item: Downloads Given the following bash script: #!/bin/bashmynumber=5guess=0echo -e "I am thinking of a number from 1 to 10\n"read -p "Enter guess: " guessif (( guess == mynumber ))thenecho "That is correct!"elif (( guess != mynumber )); thenecho "Sorry, that is not my number!"fi Which of the following would be displayed if the number 12 is entered as the guess? - Sorry, that is not my number! You are writing a bash script that lists the contents of a file. You would like to have any stderr messages sent to a file. Which of the following commands will write the error message to a projects.err file? - cat projects 2> projects.err Which of the following statements is true about the command myscript < mydata.txt? - myscript receives input (stdin) from mydata.txt. Given the command ls > myfiles which of the following describes the results? - The stdout of the ls command is redirected to the myfiles file. Given the following bash script: #!/bin/bash declare -i count=5until [ $count -lt 3 ]doecho count $countcount=count-1done
Which of the following commands can you use to configure these properties? - git config Which of the following files can you configure to ignore certain file types from being committed to the local Git repository? - .gitignore When a Git repository is created using git init, Git creates a directory named .git. This directory contains all the information necessary for that repository to work correctly. Which of the following directories contain the scripts that are run during each Git phase? - hooks Which of the following is the BEST command for showing the commit history of a repository? - git log Which of the following is the BEST command to use for joining a branch to a master? - git merge Alberto, a system administrator, is working with another system administrator, Leroy, to update the bash scripts used on various servers. The bash scripts are stored in a Git repository. Alberto updated a script that may have also been updated by Leroy. Which of the following commands SHOULD Alberto execute before he commits his changes to the repository? - git pull Lydia, a developer, recently made changes to some files and wants to update the changes on the master branch. Which of the following is the BEST command to use for this purpose? - git push
Which of the following are unique characteristics of using an agent for orchestration implementation? (Select two.) - 1. The agent can be programmed to monitor systems.