CompTIA Server+ SK0-005 Practice Question

While writing a Bash provisioning script for new Linux servers, an administrator assigns a variable and then immediately launches a helper script:

DB_CONN_STRING="postgres://svc_db@db01/prod"
./configure_app.sh

Inside configure_app.sh the value of DB_CONN_STRING is blank. The administrator wants the variable to be visible to the helper script (and any other child processes started by the provisioning script) but to disappear as soon as the provisioning script ends. Which change best satisfies this requirement?

  • Append DB_CONN_STRING="postgres://svc_db@db01/prod" to /etc/environment using sudo tee, then reload the environment.

  • Prefix the assignment with export, for example:

    export DB_CONN_STRING="postgres://svc_db@db01/prod"
    
  • Make the variable read-only with declare -r DB_CONN_STRING before launching the helper script.

  • Run the helper script with sudo so it inherits the administrator's interactive environment.

CompTIA Server+ SK0-005
Server Administration
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

SAVE $47
$390.00 $343.00
SAVE $53
CompTIA Server+ Voucher with Retake
v5 / SK0-005
Includes Retake
$439.00 $386.00
Bash, the Crucial Exams Chat Bot
AI Bot