BLACK FRIDAY SALE – Unlock Up to 25% OFF on All Exam Prep! - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

LPI 102-500 Exam - Topic 2 Question 129 Discussion

Posted by Ernie on Nov 29, 2026 at 12:03 AM

Which of the following are requirements in order to run a shell script like a regular command from anywhere in the filesystem? (Choose THREE correct answers.)

Suggested Answer: B, C, D

In order to run a shell script like a regular command from anywhere in the filesystem, the following requirements must be met:

The script file must be found in the $PATH. The $PATH is a variable that contains a list of directories where the shell looks for executable files when a command is issued. If the script file is not in one of these directories, the shell will not be able to find it unless the full path is specified.

The script file must have the executable permission bit set. This is a file attribute that determines whether the file can be executed by the user, the group, or others. The executable permission bit can be set using the chmod command, for example:chmod +x script.sh.

The script must begin with a shebang-line (#!) that points to the correct interpreter. This is a special line at the beginning of the script that tells the shell which program to use to run the script, such as#!/bin/bashfor bash scripts, or#!/usr/bin/perlfor perl scripts. The shebang-line must match the exact path of the interpreter, otherwise the script will not run.

The other options are not requirements for running a shell script like a regular command. There is no such group as script, and the file system mount option scripts does not exist.Reference:

[LPI Linux Essentials - Topic 105: Shells, Scripting and Data Management]

[LPI Linux Professional - Exam 102 Objectives - Topic 105: Shells and Shell Scripting]


Get Premium 102-500 Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
0 comments · newest first

Currently there are no comments in this discussion, be the first to comment!

0/2000 characters

Save Cancel