Linux · Flashcard

Which command makes a shell variable available to programs started from that shell?

  • Aexport, which marks the variable for inheritance by children
  • Bdeclare -i, which makes the variable hold integers only
  • Creadonly, which forbids any later change to the variable
  • Dunset, which deletes the variable from the current shell

Why this is the answer

export moves the variable into the environment, which is the copy every child process inherits — a variable that is only set stays private to this shell. declare -i and readonly change how the variable behaves here, and unset removes it entirely.

Official docs
Study in Gnoseed →