4.8 Scripting Flashcards

Identify the basics of scripting

1
Q

Shell script

A

Text-based file that contains commands that can be interpreted and
presented to the computer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Batch file

A

Text-based file containing Windows commands and is interpreted from
the command line environment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

From where can batch files be operated?

A

The command-line environment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the naming scheme for PowerShell commandlets?

A

verb-noun

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Advantage of PowerShell over batch files

A

Allows for more complex scripts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Give three things PowerShell can change/interact with

A
  • Windows components
  • Windows features
  • Active Directory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Where does .vbs run from?

A

Inside other applications, mainly Office products

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Describe how Linux Shell Script (.sh) works

A

Similar to a batch script inside of Windows

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Where is JavaScript designed to be implemented?

A

Inside a web-based interface

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Aside from websites and web apps, where is .js used?

A

Scripting languages on macOS desktops and servers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What systems can Python run on?

A

Windows, Mac and Linux

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Why is Python considered an interpreted language?

A

Because it is cross-platform in nature

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What three scripts only run on Windows

A

.vbs
.ps1
.bat

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Boolean

A

A form of data with only two possible values (T or F)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Give the three names for a variable that stores a decimal number

A

Float, decimal, real number

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Character variable

A

Can only store ASCII character

17
Q

String

A

A variable that can store multiple characters

18
Q

Give two features unique to pseudocode

A
  • No need to define data type of each variable
  • Variables can change throughout the program’s execution
19
Q

Constant

A

Similar to a variable but cannot be changed within the program once it is defined

20
Q

Loop

A

A type of flow control that controls which order the code will be executed in a given program

21
Q

For loop

A

Used when the number of times to repeat a block of code is known

22
Q

While loop

A

Used when the number of times to repeat a block of code is not known and will only stop when a certain event happens

23
Q

Do loop

A

Used when an indefinite iteration needs to happen; will only stop until some condition is met at the end of the loop

24
Q

Logic control

A

Provides conditions based on didfferent logical tests

25
Q

echo

A

Printing on screen

26
Q

if [condition]

A

Logical construct

27
Q

$1

A

Variable

28
Q

How is network drive remapping done?

A

Within normal CLI using a batch file or PowerShell

29
Q

What are APT and YUM?

A

Popular package management systems created for Debian-based and Red Hat-based Linux distributions, respectively

30
Q

How do you run apt or yum?

A

BASH script

31
Q

Bash script

A

A plain text file containing a series of commands

32
Q

Give four commands that can be used for backup automation

A
  • copy/xcopy/robocopy
  • copy (cp)
  • Windows Task Scheduler
  • Crontab
33
Q

List three possible negative consequences to be aware of when scripting

A
  • Unintentionally introducing malware
  • Inadvertently changing system settings
  • Causing browser or system crashes due to mishandling resources
34
Q

What is best practice when running a script?

A

Use the lowest permissions required

35
Q

How can scripting result in hard drive storage space being depleted?

A

Because of all the log files/temporary files created as part of the scripting process

36
Q

What can be lost due to faulty loops?

A

Network or memory resources

37
Q

What could cause the file explorer or command interpreter to crash?

A

Incorrect API calls