CompTIA Linux+ XK0-006 (V8) Practice Question

While reviewing a Bash script that cron runs nightly, you notice that ps lists both the script's /bin/bash process and the long-running /usr/local/bin/backup.sh process it launches. You want the cron-spawned PID to be replaced by backup.sh so that no extra shell remains and any signals sent to the original PID go directly to backup.sh. Which change to the script accomplishes this without spawning an additional process?

  • Launch the job detached:

    nohup /usr/local/bin/backup.sh &
    
  • Clear the environment before running:

    env -i /usr/local/bin/backup.sh
    
  • Background then disown the job:

    /usr/local/bin/backup.sh & disown
    
  • Replace the launch line with:

    exec /usr/local/bin/backup.sh
    
CompTIA Linux+ XK0-006 (V8)
Services and User Management
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.

Bash, the Crucial Exams Chat Bot
AI Bot