# Shell

- [第一部分 初见shell](https://wiki.clay-wangzhi.com/shell/part1.md)
- [1. 为什么使用shell编程](https://wiki.clay-wangzhi.com/shell/part1/01_shell_programming.md)
- [2. 和Sha-Bang(#!)一起出发](https://wiki.clay-wangzhi.com/shell/part1/02_starting_off_with_a_sha_bang.md)
- [2.1 调用一个脚本](https://wiki.clay-wangzhi.com/shell/part1/02_starting_off_with_a_sha_bang/02_1_invoking_the_script.md)
- [2.2 牛刀小试](https://wiki.clay-wangzhi.com/shell/part1/02_starting_off_with_a_sha_bang/02_2_preliminary_exercises.md)
- [第二部分 shell基础](https://wiki.clay-wangzhi.com/shell/part2.md)
- [3. 特殊字符](https://wiki.clay-wangzhi.com/shell/part2/03_special_characters.md)
- [4. 变量与参数](https://wiki.clay-wangzhi.com/shell/part2/04_introduction_to_variables_and_parameters.md)
- [4.1 变量替换](https://wiki.clay-wangzhi.com/shell/part2/04_introduction_to_variables_and_parameters/04_1_variable_substitution.md)
- [4.2 变量赋值](https://wiki.clay-wangzhi.com/shell/part2/04_introduction_to_variables_and_parameters/04_2_variable_assignment.md)
- [4.3 Bash弱类型变量](https://wiki.clay-wangzhi.com/shell/part2/04_introduction_to_variables_and_parameters/04_3_bash_variables_are_untyped.md)
- [4.4 特殊变量类型](https://wiki.clay-wangzhi.com/shell/part2/04_introduction_to_variables_and_parameters/04_4_special_variable_types.md)
- [5. 引用](https://wiki.clay-wangzhi.com/shell/part2/05_quoting.md)
- [5.1 引用变量](https://wiki.clay-wangzhi.com/shell/part2/05_quoting/05_1_quoting_variables.md)
- [5.2 转义](https://wiki.clay-wangzhi.com/shell/part2/05_quoting/05_2_escaping.md)
- [6. 退出与退出状态](https://wiki.clay-wangzhi.com/shell/part2/06_exit_and_exit_status.md)
- [7. 测试](https://wiki.clay-wangzhi.com/shell/part2/07_tests.md)
- [7.1 测试结构](https://wiki.clay-wangzhi.com/shell/part2/07_tests/07_1_test_constructs.md)
- [7.2 文件测试操作](https://wiki.clay-wangzhi.com/shell/part2/07_tests/07_2_file_test_operators.md)
- [7.3 其他比较操作](https://wiki.clay-wangzhi.com/shell/part2/07_tests/07_3_other_comparison_operators.md)
- [7.4 嵌套 if/then 条件测试](https://wiki.clay-wangzhi.com/shell/part2/07_tests/07_4_nested_if_then_condition_tests.md)
- [7.5 牛刀小试](https://wiki.clay-wangzhi.com/shell/part2/07_tests/07_5_testing_your_knowledge_of_tests.md)
- [8. 运算符相关话题](https://wiki.clay-wangzhi.com/shell/part2/08_operations_and_related_topics.md)
- [8.1 运算符](https://wiki.clay-wangzhi.com/shell/part2/08_operations_and_related_topics/08_1_operators.md)
- [8.2 数字常量](https://wiki.clay-wangzhi.com/shell/part2/08_operations_and_related_topics/08_2_numerical_constants.md)
- [8.3 双圆括号结构](https://wiki.clay-wangzhi.com/shell/part2/08_operations_and_related_topics/08_3_the_double_parentheses_construct.md)
- [8.4 运算符优先级](https://wiki.clay-wangzhi.com/shell/part2/08_operations_and_related_topics/08_4_operator_precedence.md)
- [第三部分 shell进阶](https://wiki.clay-wangzhi.com/shell/part3.md)
- [9. 换个角度看变量](https://wiki.clay-wangzhi.com/shell/part3/09_another_look_at_variables.md)
- [9.1 内部变量](https://wiki.clay-wangzhi.com/shell/part3/09_another_look_at_variables/09_1_internal_variables.md)
- [9.2 变量类型标注：declare 与 typeset](https://wiki.clay-wangzhi.com/shell/part3/09_another_look_at_variables/09_2_typing_variables_declare_or_typeset.md)
- [9.2.1 declare 的另类用法](https://wiki.clay-wangzhi.com/shell/part3/09_another_look_at_variables/09_2_typing_variables_declare_or_typeset/09_2_1_another_use_for_declare.md)
- [9.3 $RANDOM：生成随机数](https://wiki.clay-wangzhi.com/shell/part3/09_another_look_at_variables/09_3_random_generate_random_integer.md)
- [10. 变量处理](https://wiki.clay-wangzhi.com/shell/part3/10_manipulating_variables.md)
- [10.1 字符串处理](https://wiki.clay-wangzhi.com/shell/part3/10_manipulating_variables/10_1_manipulating_strings.md)
- [10.1.1 使用 awk 处理字符串](https://wiki.clay-wangzhi.com/shell/part3/10_manipulating_variables/10_1_manipulating_strings/10_1_1_manipulating_strings_using_awk.md)
- [10.1.2 参考资料](https://wiki.clay-wangzhi.com/shell/part3/10_manipulating_variables/10_1_manipulating_strings/10_1_2_further_reference.md)
- [10.2 参数替换](https://wiki.clay-wangzhi.com/shell/part3/10_manipulating_variables/10_2_parameter_substitution.md)
- [11. 循环与分支](https://wiki.clay-wangzhi.com/shell/part3/11_loops_and_branches.md)
- [11.1 循环](https://wiki.clay-wangzhi.com/shell/part3/11_loops_and_branches/11_1_loops.md)
- [11.2 嵌套循环](https://wiki.clay-wangzhi.com/shell/part3/11_loops_and_branches/11_2_nested_loops.md)
- [11.3 循环控制](https://wiki.clay-wangzhi.com/shell/part3/11_loops_and_branches/11_3_loop_control.md)
- [11.4 测试与分支](https://wiki.clay-wangzhi.com/shell/part3/11_loops_and_branches/11_4_testing_and_branching.md)
- [12. 命令替换](https://wiki.clay-wangzhi.com/shell/part3/12_command_substitution.md)
- [13. 算术扩展](https://wiki.clay-wangzhi.com/shell/part3/13_arithmetic_expansion.md)
- [第四部分 命令](https://wiki.clay-wangzhi.com/shell/part4.md)
- [第五部分 高级话题](https://wiki.clay-wangzhi.com/shell/part5.md)
- [18.正则表达式](https://wiki.clay-wangzhi.com/shell/part5/18_regular_expressions.md)
- [18.1正则表达式简介](https://wiki.clay-wangzhi.com/shell/part5/18_regular_expressions/18_1_a_brief_introduction_to_regular_expressions.md)
- [18.2文件名替换](https://wiki.clay-wangzhi.com/shell/part5/18_regular_expressions/18_2_globbing.md)
- [18.3 正则表达式对照表](https://wiki.clay-wangzhi.com/shell/part5/18_regular_expressions/18_3_regular_expression_comparison_table.md)
- [19. 嵌入文档](https://wiki.clay-wangzhi.com/shell/part5/19_here_documents.md)
- [20. I/O 重定向](https://wiki.clay-wangzhi.com/shell/part5/20_io_redirection.md)
- [20.1 使用 exec](https://wiki.clay-wangzhi.com/shell/part5/20_io_redirection/20_1_use_exec.md)
- [20.2 重定向代码块](https://wiki.clay-wangzhi.com/shell/part5/20_io_redirection/20_2_redirecting_code_blocks.md)
- [20.3 应用程序](https://wiki.clay-wangzhi.com/shell/part5/20_io_redirection/20_3_applications.md)
- [21. 子shell](https://wiki.clay-wangzhi.com/shell/part5/21_subshells.md)
- [22. 限制模式的Shell](https://wiki.clay-wangzhi.com/shell/part5/22_restricted_shells.md)
- [23. 进程替换](https://wiki.clay-wangzhi.com/shell/part5/23_process_substitution.md)
- [24. 函数](https://wiki.clay-wangzhi.com/shell/part5/24_functions.md)
- [24.1 复杂函数和函数复杂性](https://wiki.clay-wangzhi.com/shell/part5/24_functions/24_1_complex_functions_and_function_complexities.md)
- [24.2 局部变量](https://wiki.clay-wangzhi.com/shell/part5/24_functions/24_2_local_variables.md)
- [24.3 不适用局部变量的递归](https://wiki.clay-wangzhi.com/shell/part5/24_functions/24_3_recursion_without_local_variables.md)
- [25. 别名](https://wiki.clay-wangzhi.com/shell/part5/25_aliases.md)
- [26. 列表结构](https://wiki.clay-wangzhi.com/shell/part5/26_list_constructs.md)
- [27. 数组](https://wiki.clay-wangzhi.com/shell/part5/27_arrays.md)
- [30. 网络编程](https://wiki.clay-wangzhi.com/shell/part5/30_network_programming.md)
- [33. 选项](https://wiki.clay-wangzhi.com/shell/part5/33_options.md)
- [34. 陷阱](https://wiki.clay-wangzhi.com/shell/part5/34_gotchas.md)
- [36. 其他](https://wiki.clay-wangzhi.com/shell/part5/36_miscellany.md)
- [36.5 有颜色的脚本](https://wiki.clay-wangzhi.com/shell/part5/36_miscellany/36_5_colorizing_scripts.md)
- [36.11 ssh远程操作](https://wiki.clay-wangzhi.com/shell/part5/36_miscellany/36_11_ssh_remote_operate.md)
- [第六部分 Google Shell 风格指南](https://wiki.clay-wangzhi.com/shell/part6.md)
- [第七部分 实例](https://wiki.clay-wangzhi.com/shell/shili.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.clay-wangzhi.com/shell.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
