A systems administrator is reviewing multiple maintenance scripts used across Windows and Linux workstations to audit system environment variable access and execution commands. Match each scripting code snippet or construct to its corresponding scripting language environment.
- $env:COMPUTERNAMEWindows PowerShell (.ps1)
- echo $HOSTNAMELinux Bash (.sh)
- WScript.Echo WScript.Arguments(0)VBScript (.vbs)
- import os; print(os.environ['COMPUTERNAME'])Python (.py)
Cevap
The construct ' HOSTNAME' matches Linux Bash (.sh); 'WScript.Echo WScript.Arguments(0)' matches VBScript (.vbs); and 'import os; print(os.environ["COMPUTERNAME"])' matches Python (.py).
Each script construct relies on unique syntactical elements characteristic of its underlying engine: PowerShell uses prefixes with shell built-in commands like echo, VBScript invokes WScript objects, and Python uses module imports (import os) paired with object/dictionary methods.
Adım Adım Çözüm
Anahtar Kavram
Basic Scripting Languages and Constructs