IST 191 CHAPTER 1 QUESTIONS AND VERIFIED
ANSWERS
shell scripts - Answers - Tasks with greater complexity often require chaining together
multiple commands that pass results between them. Using the Bash shell environment
and scripting features, Linux commands are combined into shell scripts to easily solve
repetitive and difficult real-world problems.
Bash shell script - Answers - an executable file that contains a list of commands, and
possibly with programming logic to control decision-making in the overall task
vim or emacs - Answers - You can create a Bash shell script by opening a new empty
file in a text editor. While you can use any text editor, advanced editors, such as vim or
emacs, understand Bash shell syntax and can provide color-coded highlighting.
Bash Shell highlighting - Answers - Highlighting helps identify common errors such as
improper syntax, unpaired quotes, unclosed parenthesis, braces, and brackets, and
much more.
#! - Answers - The first line of a script begins with the notation '#!', commonly referred to
as sh-bang or she-bang, from the names of those two characters, sharp and bang.
For script files using Bash scripting syntax, the first line of a shell script begins with -
Answers - #!/bin/bash
chmod - Answers - command to add execute permission
chown - Answers - command to change the file ownership of the script.
What command displays the path name to the command that will be executed -
Answers - The which command, followed by the file name of the executable script,
displays the path name to the command that will be executed.
Which three tools remove (or escape) the special meaning - Answers - the backslash
(\), single quotes (''), or double quotes ("")
backslash escape character - Answers - removes the special meaning of the single
character immediately following it
When you need to escape more than one character in a text string, either use the... -
Answers - escape character multiple times or employ single quotes ('')
Single quotes - Answers - preserve the literal meaning of all characters they enclose
, What are double quotation marks used for? - Answers - Use double quotation marks to
suppress globbing and shell expansion, but still allow command and variable
substitution
What is Variable Substitution? - Answers - Variable substitution is conceptually identical
to command substitution, but may use optional brace syntax.
What are single quotation marks used for? - Answers - Use single quotation marks to
interpret all text literally.
The question mark (?) is a ______-_____________ that also needs protection from
expansion - Answers - meta-character
What effect do quotations have on the shell? - Answers - Use single quotation marks to
interpret all text literally. Besides suppressing globbing and shell expansion, quotations
direct the shell to additionally suppress command and variable substitution.
echo command - Answers - displays arbitrary text by passing the text as an argument to
the command
By default, the text displays on _____________ __________________, but it can also
be directed to ________________ _______________ using output redirection. -
Answers - standard output (STDOUT); standard error (STDERR)
The ________ command is widely used in shell scripts to display informational or error
messages. - Answers - echo
What can the echo command help with? - Answers - The echo command can also be
very helpful when trying to debug a problematic shell script. The addition of echo
statements to the portion of the script that is not behaving as expected can help clarify
the commands being executed, as well as the values of variables being invoked.
In a bash shell, how do you save your work - Answers - press "esc" to get out of insert
mode and then :wq to save & quit
How do you bold your text in a bash shell? - Answers - $bold
The ________ loop is one of the multiple shell looping constructs offered by Bash, and
can be used for task iterations - Answers - for
How is the for loop used? - Answers - The list of strings provided to a for loop can be
supplied in several ways. It can be a list of strings entered directly by the user, or be
generated from different types of shell expansion, such as variable, brace, or file-name
expansion, or command substitution.
ANSWERS
shell scripts - Answers - Tasks with greater complexity often require chaining together
multiple commands that pass results between them. Using the Bash shell environment
and scripting features, Linux commands are combined into shell scripts to easily solve
repetitive and difficult real-world problems.
Bash shell script - Answers - an executable file that contains a list of commands, and
possibly with programming logic to control decision-making in the overall task
vim or emacs - Answers - You can create a Bash shell script by opening a new empty
file in a text editor. While you can use any text editor, advanced editors, such as vim or
emacs, understand Bash shell syntax and can provide color-coded highlighting.
Bash Shell highlighting - Answers - Highlighting helps identify common errors such as
improper syntax, unpaired quotes, unclosed parenthesis, braces, and brackets, and
much more.
#! - Answers - The first line of a script begins with the notation '#!', commonly referred to
as sh-bang or she-bang, from the names of those two characters, sharp and bang.
For script files using Bash scripting syntax, the first line of a shell script begins with -
Answers - #!/bin/bash
chmod - Answers - command to add execute permission
chown - Answers - command to change the file ownership of the script.
What command displays the path name to the command that will be executed -
Answers - The which command, followed by the file name of the executable script,
displays the path name to the command that will be executed.
Which three tools remove (or escape) the special meaning - Answers - the backslash
(\), single quotes (''), or double quotes ("")
backslash escape character - Answers - removes the special meaning of the single
character immediately following it
When you need to escape more than one character in a text string, either use the... -
Answers - escape character multiple times or employ single quotes ('')
Single quotes - Answers - preserve the literal meaning of all characters they enclose
, What are double quotation marks used for? - Answers - Use double quotation marks to
suppress globbing and shell expansion, but still allow command and variable
substitution
What is Variable Substitution? - Answers - Variable substitution is conceptually identical
to command substitution, but may use optional brace syntax.
What are single quotation marks used for? - Answers - Use single quotation marks to
interpret all text literally.
The question mark (?) is a ______-_____________ that also needs protection from
expansion - Answers - meta-character
What effect do quotations have on the shell? - Answers - Use single quotation marks to
interpret all text literally. Besides suppressing globbing and shell expansion, quotations
direct the shell to additionally suppress command and variable substitution.
echo command - Answers - displays arbitrary text by passing the text as an argument to
the command
By default, the text displays on _____________ __________________, but it can also
be directed to ________________ _______________ using output redirection. -
Answers - standard output (STDOUT); standard error (STDERR)
The ________ command is widely used in shell scripts to display informational or error
messages. - Answers - echo
What can the echo command help with? - Answers - The echo command can also be
very helpful when trying to debug a problematic shell script. The addition of echo
statements to the portion of the script that is not behaving as expected can help clarify
the commands being executed, as well as the values of variables being invoked.
In a bash shell, how do you save your work - Answers - press "esc" to get out of insert
mode and then :wq to save & quit
How do you bold your text in a bash shell? - Answers - $bold
The ________ loop is one of the multiple shell looping constructs offered by Bash, and
can be used for task iterations - Answers - for
How is the for loop used? - Answers - The list of strings provided to a for loop can be
supplied in several ways. It can be a list of strings entered directly by the user, or be
generated from different types of shell expansion, such as variable, brace, or file-name
expansion, or command substitution.