1/25
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No study sessions yet.
there are never errors in scripts as they are develped (t/f)
so f*cking false, if u said true im afraid you have a lying problem
when an error is encountered, the script can error out (t/f)
true (pls tell me this question is on the exam)
a partially completed or misbehaving script can cause damage to a system/data (t/f)
true
what is best practice for scripts?
test it before deploying
what should the first line of code be in a bash script?
#! /bin/bash
what is the best way to debug a new or unknown script?
#! /bin/bash -xv
what is the default debug option?
none
the set command is not useful for debuggin in bash (t/f)
false, it is useful and can be used
how would you turn debugging on using the 'set' command?
set -n;
what does -n mean in regard to the 'set' command?
debugging is on
what does +n mean in regard to the 'set' command?
debugging is off
what does -n stand for?
no execute
what does -n do?
reads every line, but does not execute them
the -n flag also does syntax checking (t/f)
true
the -n flag will explain the exact error and where it is (t/f)
false, it will indiciate if syntax is present, but not the exact error
what is the -v debug option?
verbose mode
what does the -v debug option do?
displays lines as the script reads them
the -v debug option can be combined with others (t/f)
true
what is the -nv debug option?
no exec verbose
what does the -nv debug option do?
copies every line to stdout as it is read, even if there are no errors
what does the -nv debug option do for execution?
it does nothing, does not execute
what is the -x debug option?
shell tracing (dispaly commands and arguments as executed)
lines listed in -x with no '+' are the command result lines sent to ___
stdout
what is a quick way to enable debugging in a script is through ___
debugging hook function
what does a debugging hook function use to determine if debugging is enabled?
environment variable
the debugging hook is useful for initial testing and deployment (t/f)
true