CNIT 340 Debugging

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall with Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/25

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No study sessions yet.

26 Terms

1
New cards

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

2
New cards

when an error is encountered, the script can error out (t/f)

true (pls tell me this question is on the exam)

3
New cards

a partially completed or misbehaving script can cause damage to a system/data (t/f)

true

4
New cards

what is best practice for scripts?

test it before deploying

5
New cards

what should the first line of code be in a bash script?

#! /bin/bash

6
New cards

what is the best way to debug a new or unknown script?

#! /bin/bash -xv

7
New cards

what is the default debug option?

none

8
New cards

the set command is not useful for debuggin in bash (t/f)

false, it is useful and can be used

9
New cards

how would you turn debugging on using the 'set' command?

set -n; ; set +n

10
New cards

what does -n mean in regard to the 'set' command?

debugging is on

11
New cards

what does +n mean in regard to the 'set' command?

debugging is off

12
New cards

what does -n stand for?

no execute

13
New cards

what does -n do?

reads every line, but does not execute them

14
New cards

the -n flag also does syntax checking (t/f)

true

15
New cards

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

16
New cards

what is the -v debug option?

verbose mode

17
New cards

what does the -v debug option do?

displays lines as the script reads them

18
New cards

the -v debug option can be combined with others (t/f)

true

19
New cards

what is the -nv debug option?

no exec verbose

20
New cards

what does the -nv debug option do?

copies every line to stdout as it is read, even if there are no errors

21
New cards

what does the -nv debug option do for execution?

it does nothing, does not execute

22
New cards

what is the -x debug option?

shell tracing (dispaly commands and arguments as executed)

23
New cards

lines listed in -x with no '+' are the command result lines sent to ___

stdout

24
New cards

what is a quick way to enable debugging in a script is through ___

debugging hook function

25
New cards

what does a debugging hook function use to determine if debugging is enabled?

environment variable

26
New cards

the debugging hook is useful for initial testing and deployment (t/f)

true