Question

Difficulty: EasyBasic Scripting Languages and Constructs

A system administrator is creating an automated maintenance script to run natively within the default command-line terminal environment of a macOS workstation. Which file extension should the administrator assign to this script?

  1. .shAnswer
  2. B
    .bat
  3. C
    .ps1
  4. D
    .vbs

Answer

The `.sh` file extension should be used for native shell scripts executed in a macOS terminal environment.
The `.sh` file extension is standard for shell scripts created to execute in Unix-like terminal environments, including macOS (which uses Zsh and Bash) and Linux.

Step-by-Step Solution

1
Identify the target operating system environment specified in the scenario.
The target operating system is macOS using a native command-line terminal.
macOS is a Unix-based operating system.
2
Determine the standard scripting extension associated with native Unix/macOS shell environments (such as Zsh or Bash).
Shell scripts running in these environments conventionally use the `.sh` file extension.
Scripting extensions specify the engine or runtime host meant to interpret the script.

Key Concept

Scripting Language File Extensions and Execution Environments
Rate this question