A helpdesk technician is creating an automated maintenance script for newly onboarded macOS and Linux workstations. The script must execute natively within the default Unix shell environment to parse system logs and access environment variables. Which file extension and variable reference syntax should the technician select for a variable named LOG_DIR?
- .sh file extension using $LOG_DIR to reference the variableCevap
- B.bat file extension using %LOG_DIR% to reference the variable
- C.ps1 file extension using $env:LOG_DIR to reference the variable
- D.vbs file extension using Dim LOG_DIR to reference the variable
Cevap
The technician should use the .sh file extension and reference the variable using $LOG_DIR.
Unix-based operating systems like macOS and Linux use shell scripts (.sh) interpreted by shells such as Bash or Zsh. In these scripts, variables are referenced using the dollar sign prefix ($LOG_DIR).
Adım Adım Çözüm
Anahtar Kavram
Scripting Languages and Syntax Conventions