Scripting( Comptia Objective 4.8) Flashcards

1
Q

What is the purpose of scripting and automation?

A
  • Automate tasks. You don’t have to be there, solve problems in your sleep.
  • Monitor and resolve problems before they happen.
  • The need for speed. The script is as fast as the computer. No typing or delays, no human error.
  • Good for automating mundane tasks. You can do something more creative.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are some scripting basics?

A
  • Variables. Associate a name with an area of memory.
    x=1. y=x+7. Therefore, y=8.
  • pi =3.14
  • Greeting = “Hello and Welcome” .
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are some scripting data types?

A
  • String data types are typically text or names such as :
    name= “Elon Musk”
  • Integer data types are typically whole numbers(not fractions) such as x=42 and perform numerical calculations.
  • Floating point data types are numbers with decimal points such as pi=3.14
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are loops when it comes to scripting?

A
  • Loops perform a process over and over again.
  • Loop for a certain number of times or loop until something happens.
  • Is a good idea to include comments annotate/document the code being used in the script to advise of what’s happening within the script. There never seems to be enough of this.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are Environment variables?

A
  • Describes the operating system environment. Scripts then use these to make decisions.
  • Common variables include things such as ;
    1. Location of the windows installation
    2. The search path
    3. The name of the computer
    4. The drive letter and path of the user’s home directory.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

A very common scripting type within the Windows Environment is?

A
  • Batch files
  • Use the .bat file extension.
  • Provides scripting for Windows at the command line.
  • Legacy goes back to DOS and OS/2.
  • Text inside these scripts will look very similar to command prompt text with similar commands such as “ cd” “ xcopy” etc.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is another type of scripting language within Windows that you will see on a regular basis?

A
  • Windows PowerShell
  • Provides a command line for system administrators and commonly uses the .ps1 file extension.
  • Is included with Windows 8/8.1 and 10.
  • Extends command-line functions powershell scripts are often referred to as cmdlets( command-lets)
  • Powershell takes the idea of running a Windows batch file and extends it to allow you control basically every aspect of the windows operating system.
  • Powershell includes scripts and functions as well as Standalone executables.
  • Powershell also provides a way to automate and integrate things such as system administration of Active Directory/ Active Domain administration.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

A less commonly used old type of scripting language for Windows is?

A
  • Microsoft Visual Basic Scripting Edition. VBScript and uses a .vbs file extension.
  • Provides general purpose scripting inside of Windows commonly used for ;
  • Back-end web server scripting, scripting on the Windows desktop, scripting inside of Microsoft Office applications.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the scripting language used inside of Linux or Unix that has similar functionality to that of Powershell or Batch?

A
  • Shell script. Scripting for Unix/Linux shell. Allows you to automate and extend the command line.
  • Starts with a shebang or hash-bang #!. Often these types or scripts will use a .sh file extension.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is an excellent scripting language commonly used by IT professionals?

A
  • Python. General purpose scripting language and use the .py file extension. Similar to shell script the script will start with w shebang or hashbang(#!) however after the hashbang you will typically see text such as “ /usr/bin/python3” that identifies the script as python.
  • Popular in many technologies and has broad appeal and support across many different operating systems.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What type of scripting language is used inside of your web browser?

A
  • Javascript provides scripting inside of your browser and uses a .js file extension.
  • Adds interactivity to HTML and CSS. Which is used on almost every web site.
  • JavaScript is not Java. Javascript is a scripting language inside of web browsers and Java is a programming language used by developers. Have very different uses and implementation.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly