简介
在本挑战中,你将创建一个处理命令行参数的 bash 脚本。该脚本将展示 bash 脚本编程中的关键概念,包括处理命令行参数、使用特殊变量以及显示进程信息。此任务对于需要创建灵活且信息丰富的命令行工具的系统管理员和开发人员至关重要。
环境
LabEx 使用 Red Hat Universal Base Image 9 (UBI9) 来模拟考试环境。它可能与实际的 RHCSA 考试环境不完全相同,但能很好地代表你将遇到的任务。
环境中有两个用户:
labex
:具有 sudo 权限的标准用户,密码为labex
。root
:系统管理员,密码为redhat
。
该挑战包含真实的考试题目,并配有解释、要求和自动化验证脚本,以帮助你确认任务完成情况。它有效地模拟了 RHCSA 考试所涵盖的知识领域。
Skills Graph
%%%%{init: {'theme':'neutral'}}%%%%
flowchart RL
shell(("Shell")) -.-> shell/VariableHandlingGroup(["Variable Handling"])
linux(("Linux")) -.-> linux/BasicFileOperationsGroup(["Basic File Operations"])
shell(("Shell")) -.-> shell/FunctionsandScopeGroup(["Functions and Scope"])
shell/VariableHandlingGroup -.-> shell/variables_usage("Variable Usage")
shell/VariableHandlingGroup -.-> shell/param_expansion("Parameter Expansion")
linux/BasicFileOperationsGroup -.-> linux/chmod("Permission Modifying")
shell/FunctionsandScopeGroup -.-> shell/func_def("Function Definition")
subgraph Lab Skills
shell/variables_usage -.-> lab-416107{{"在 Bash 脚本中处理参数"}}
shell/param_expansion -.-> lab-416107{{"在 Bash 脚本中处理参数"}}
linux/chmod -.-> lab-416107{{"在 Bash 脚本中处理参数"}}
shell/func_def -.-> lab-416107{{"在 Bash 脚本中处理参数"}}
end