wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

A+ - 19D - Identify Basics of Scripting

Total questions: 2

Worksheet time: 12mins

Name
Class
Date
1-19.

Shell scripting involves writing a series of instructions in the syntax of a particular language to perform tasks on a computer. There are three main types of coding languages: shell scripting languages, general-purpose scripting languages, and programming languages. Shell scripting languages use commands specific to an operating system, while general-purpose scripting languages use statements and modules independent of the operating system. Programming languages are used to compile executable files that can be installed on an OS and run as an app.

Shell scripting is often referred to as a glue language because it's used to automate and orchestrate functions across multiple OS and app software. Scripts can be developed in basic text editors, but using editors with script support or integrated development environments (IDEs) enhances productivity by providing syntax parsing, highlighting, autocomplete features, and debugging tools.

In Linux, shell scripts have a .sh extension and start with a shebang line that designates which interpreter to use, such as Bash or Ksh. Each statement in a script is typically added on separate lines. Shell scripts must have execute permission set to run, and they can be executed from the working directory or with a full path.

Basic script constructs include comments, variables, branches, and loops. Comments assist with maintaining code and are indicated by a special delimiter, typically a hash sign (#). Variables are labels for values that can change during script execution, while branches and loops allow for conditional execution and repeated statement blocks, respectively.

Windows supports several shell coding environments, including PowerShell, Visual Basic Script, and the CMD interpreter. PowerShell combines a script language with prebuilt modules called cmdlets for Windows and Active Directory management. Visual Basic Script is based on Visual Basic and is identified by the .vbs extension. Batch files use the .bat extension and are written for the basic Windows CMD interpreter.

JavaScript and Python are platform-independent scripting and programming languages. JavaScript is used for interactive web-based content and web apps, while Python is a general-purpose language for automation scripts and software apps. JavaScript files have a .js extension, and Python files have a .py extension.

Scripting is commonly used for automation, such as restarting machines, remapping network drives, installing applications, initiating updates, performing backups, and gathering information/data. Best practices for scripting include mitigating malware risks, preventing inadvertent system-setting changes, and avoiding browser or system crashes due to mishandling of resources.

1.

Which of the following distinctions is NOT a helpful way to categorize coding languages?

a)

Shell scripting language

b)

General-purpose scripting language

c)

Object-oriented programming language

d)

Assembly language

2.

What term describes the characteristic of shell scripting languages to automate and orchestrate functions across multiple OS and app software?

a)

Glue language

b)

General-purpose language

c)

Integrated language

d)

Universal language

3.

Which file extension is commonly used for Linux shell scripts?

a)

.py

b)

.vbs

c)

.bat

d)

.sh

4.

What is the purpose of a shebang line in a shell script?

a)

To designate the programming language

b)

To indicate the end of the script

c)

To specify the execution permissions

d)

To identify the script editor

5.

Which scripting language combines a script language with prebuilt modules called cmdlets for Windows and Active Directory management?

a)

JavaScript

b)

Python

c)

PowerShell

d)

VBScript

6.

What is the file extension for Visual Basic Script files?

a)

.py

b)

.vbs

c)

.bat

d)

.sh

7.

Which scripting language is commonly used for interactive web-based content and web apps?

a)

JavaScript

b)

Python

c)

PowerShell

d)

VBScript

8.

Which type of scripting language is used to compile an executable file that can be installed on an OS and run as an app?

a)

Shell scripting language

b)

General-purpose scripting language

c)

Programming language

d)

Integrated language

9.

What construct in a script allows for the repeated execution of a statement block based on some type of condition?

a)

Comments

b)

Variables

c)

Branches

d)

Loops

10.

Which operator in a test resolves to a TRUE or FALSE value?

a)

Comparison operator

b)

Arithmetic operator

c)

Logical operator

d)

Assignment operator

11.

What term describes the characteristic of a scripting language to manipulate text and filter data from the output of commands?

a)

Automation

b)

Debugging

c)

Parsing

d)

Glueing

12.

What is the primary use case for scripting?

a)

Data visualization

b)

Web development

c)

Basic automation

d)

Software debugging

13.

What type of risk involves modifying the source code of a script to act in an adverse or insecure manner?

a)

Inadvertent system-settings changes

b)

Browser or system crashes

c)

Malware risks

d)

Mishandling of resources

14.

What construct is used in Windows batch files to perform drive mapping?

a)

New-PSDrive

b)

Test-Path

c)

net use

d)

Get-PSDrive

15.

Which type of scripting language is designed to automate and orchestrate functions of multiple different OS and app software?

a)

Shell scripting language

b)

General-purpose scripting language

c)

Programming language

d)

Integrated language

16.

Which operator in a script tests whether the first positional parameter is unset or empty?

a)

-z

b)

-n

c)

-eq

d)

-It

17.

What construct is used to declare a label for some value that can change during script execution?

a)

Comments

b)

Variables

c)

Branches

d)

Loops

18.

What construct is used to execute a different sequence of instructions based on the outcome of some logical test?

a)

Comments

b)

Variables

c)

Branches

d)

Loops

19.

Which scripting language is identified by the .py extension?

a)

PowerShell

b)

Visual Basic Script

c)

JavaScript

d)

Python

20.

Have you submitted your Daily Standup Form yet?

Click the link below.

https://airtable.com/appg2CeX4DA9Y7hDi/shrUyD9aoryvXZgfu

a)

I have now

b)

Not yet