Courseiva

LPIC-1 Shells, Scripting and Data Management Practice Question

A user runs the command `echo $HOME` in a Bash shell and receives the output `/home/alice`. A colleague later runs the same command in a different shell and gets `/root`. Which type of shell variable is being displayed?

⚠ Common exam trap

The trap here is assuming that any variable set in a shell is automatically an environment variable, when many variables remain local unless exported.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

An environment variable

HOME is an environment variable that is exported to child processes, so it is inherited by commands run from the shell. It is set at login time based on the user account, which is why different users see different values. Local variables, positional parameters, and special parameters do not behave this way.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    A local shell variable

    Why it's wrong here

    A local shell variable exists only in the current shell and is not inherited by child processes. HOME is exported and visible to child commands, so it is not merely local. The differing values between users also indicate it is part of the environment rather than a shell-specific local setting.

  • ✓

    An environment variable

    Why this is correct

    HOME is an environment variable that is exported to child processes. It is set by the login process and reflects the home directory of the user who started the shell. Because it is inherited, a different user or a shell started with a different effective user will show a different value, which explains the observed difference.

  • ✗

    A special shell parameter

    Why it's wrong here

    Special parameters such as $?, $$, $!, and $# have specific meanings and are not named. HOME is a named variable that stores a directory path. Although it is important, it is not one of the special parameters that Bash defines for process and status information.

  • ✗

    A positional parameter

    Why it's wrong here

    Positional parameters are accessed as $1, $2, and so on, and hold arguments passed to a script or function. They are not named like HOME and are not set by the login process. The output of echo $HOME is a named variable, not a positional parameter.

About these practice questions

One of 402 original LPIC-1 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official LPI exam blueprint

This LPIC-1 practice question is part of Courseiva's free LPI certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LPIC-1 exam.