The document defines various terms related to source code management (SCM) and bash scripting. It provides multiple choice questions to test understanding of concepts like what SCM stands for (source code management), common SCM tools (git), bash script syntax (shebang), bash variables, regular expressions, and more. The last question asks to name two ways of working with SCM, to which the answer is distributed and centralized.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
60 views3 pages
Linux 2 - Test1.answers
The document defines various terms related to source code management (SCM) and bash scripting. It provides multiple choice questions to test understanding of concepts like what SCM stands for (source code management), common SCM tools (git), bash script syntax (shebang), bash variables, regular expressions, and more. The last question asks to name two ways of working with SCM, to which the answer is distributed and centralized.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3
1) What does SCM stand for?
A) System Configuration Management
B) Steve’s Comedy Manager C) Source Code Management D) Solidly Confusing Maniac Answer: C 2) What is SCM commonly used for? A) Keeping track of documentation, configuration and source code files B) Remote system configuration C) Storing large movies across multiple devices D) Steve’s laundry list Answer: A 3) The most commonly used SCM tool? A) steviethetv B) git C) hg D) gg Answer: B 4) Which shell doesn’t exist? A) Ksh B) bash C) csh D) ubtnshell Answer: D 5) What should every script have at the beginning of it? A) Bang B) Sha-bang C) Exclamation point D) Password for your email Answer: B 6) When should you avoid writing bash scripts? A) If you’re trying to automate backups B) Windows…? I’m sorry. C) If you’re trying to do simple math D) If you need a GUI Answer: D 7) How can you run a script without enabling the executable bit on it? A) ./script.sh B) script.sh C) bash script.sh D) .script.sh Answer: C 8) Which bash environment file is system-wide? A) /usr/etc/profile B) /etc/../$HOME/.bashrc C) /etc/steves.movies D) /etc/../../../etc/../etc/profile Answer: D 9) What command can be used to “re-import” changes to your bash configuration files? A) import B) getfile C) reset D) source Answer: D 10) What does the character # do at the beginning of a line when the second character is NOT ! (#!)? A) spawns a subshell B) starts a comment C) acts as a placeholder for a macro D) is the magic number that indicates a script Answer: B 11) What is the problem with the following code: case=value0 ? A) = needs to be surrounded by spaces like this: case = value0 B) the value of the variable case must be either value or 0, cannot hold the value "value0" C) a variable cannot have the name case D) the case=value0 must be terminated with a ; at the end like this "case=value0;" Answer: C 12) You want to declare a variable named var1 with the value 23. How do you do this? A) var1=23 B) var1 = 23 C) var1=23; D) $var1=23 Answer: A 13) = and -eq are both used for comparing values. What is the difference between them? A) There is no difference between = and -eq B) = compares integers and -eq compares literal variables/strings C) Only -eq can be used to compare values D) = compares literal variables/strings and -eq compares integers Answer: D 14) What does the special character ; do? A) It is a command separator and allows you to run two or more commands on the same line B) It is the way to start a comment in your script C) It terminates an option in a case statement D) It is used to source files into your current script Answer: A 15) What does the following code do? echo HEJ! > t.txt A) It writes the text HEJ! to the file t.txt and erases any existing text in the file B) It appends the text HEJ! to the file t.txt saving any existing text in the file C) It results in a syntax error due to faulty syntax D) It writes the text t.txt to the file HEJ! Answer: A 16) What is the definition of a regular expression? A) Regular Expressions are sets of metaphorical characters that uniquely embrace systems B) Regular Expressions is a single character that match (or specify) patterns C) Regular Expressions are sets of characters and/or metacharacters that exclude (or limit) pattern constructs D) Regular Expressions are sets of characters and/or metacharacters that match (or specify) patterns Answer: D 17) In regular expressions you will frequently encounter ^ and $. What do they mean? A) ^ matches 0 or more characters and $ invokes a variable B) ^ means the end of a line and $ means the beginning of a line C) ^ means the beginning of a line and $ means the end of a line D) ^ means invoking a variable and $ matches only numbers Answer: C 18) What does the following code do? files=$(ls) A) Stores the output of the command ls in the variable files B) Stores the value of the variable ls in the variable files C) Stores the value "$(ls)" in the variable files D) Stores the value of the exit code of the command ls in the variable file Answer: A 19) What is the value of an uninitialized variable? A) 0 B) 1 C) 2 D) null Answer: D 20) Name two ways of working with SCM? A) Centralized and federated B) Federated and circumscribed C) Distributed and centralized D) Centralized and federated Answer: C