Question

Difficulty: EasyBasic Scripting Languages and Constructs

A system administrator is creating a native shell script to automate routine backup tasks on a Linux server. Which file extension should the administrator assign to this script?

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

Answer

The administrator should assign the .sh file extension to the Linux shell script.
The .sh file extension designates a shell script executable within Linux and Unix command shells such as Bash.

Step-by-Step Solution

1
Identify the target operating system and scripting environment from the scenario.
The server runs Linux, requiring a native Linux shell script environment (such as Bash).
Script extensions correspond directly to their target operating systems and shell runtimes.
2
Match the Linux shell environment with its designated file extension.
.sh is identified as the standard file extension for shell scripts.
Unix and Linux shell scripts conventionally use the .sh extension.

Key Concept

Basic scripting language file extensions and execution environments
Rate this question