FLASH CARDS

4.11.1 Identify the basics of scripting - Part 1

  • What is coding?

  • Writing instructions in a language's syntax to execute tasks on a computer.

  • What is a shell scripting language?

  • A scripting language that uses OS-specific commands to perform tasks.

  • What is a general-purpose scripting language?

  • A language with OS-independent commands, executed by an interpreter.

  • What is a programming language used for in scripting?

  • To compile an executable file that can run as an application on an OS.

  • Why are scripting languages often called “glue languages”?

  • They automate and coordinate functions across different OS and app software.

  • What are some advantages of using an editor with script support?

  • It can parse syntax, highlight elements, and provide debugging tools.

  • What is a "shebang" line in Linux shell scripting?

  • The line (e.g., #!/bin/bash) specifying which interpreter to use for the script.

  • What file permission must be set for a script to execute in Linux?

  • Execute permission for user, group, or world.

  • What is syntax in scripting?

  • The correct structure and rules of a language required to execute a script.

  • What is the function of a comment in scripting?

  • It provides information or explanation in the code, ignored by the interpreter.

  • How are comments indicated in Bash and PowerShell?

  • By a hash or pound sign (#).

  • What is a variable in scripting?

  • A label for a value that can change as the script executes.

  • What is a parameter (or argument) in scripting?

  • A variable passed to the script when it’s executed, e.g., $1 in Bash.

  • What is a "branch" in scripting?

  • An instruction to execute a different sequence of steps based on a condition.

  • What is a "loop" in scripting?

  • A structure that repeats a statement block based on a set condition.

  • What does a "For" loop do in a script?

  • Repeats a block of code for a predictable number of times.

  • What is a "While" loop in scripting?

  • Repeats a block of code until a specified condition is met.

  • What is the difference between == and != in scripting?

  • == checks for equality, while != checks for inequality.

  • How does the AND (&&) operator work in scripts?

  • It returns TRUE if both conditions are TRUE.

  • What does the OR (||) operator do in scripting?

  • Returns TRUE if either condition is TRUE.