# \`\`符号和脚本进程

在编写脚本中，经常会使用"\`\`"（back quote）符号来来执行指令（命令替换），作用是将命令的输出替换到字符串或者变量中。

例如以下命令获取版本号存放到变量`redhat_version`中便于脚本中引用：

```bash
redhat_version=`cat /etc/redhat-release`
```

但是，需要注意的是，使用 "\`\`" 符号执行指令会fork出脚本子进程来执行，也就是说，如果在脚本 test.sh 使用 back quote符号，此时会在系统中又出现一个 test.sh 名称的子进程。

虽然一般没有影响，但是在某些情况下，会在脚本中统计系统中有多少个"自己"的进程数量（主要是为了防止重复执行脚本，所以统计脚本进程数，超过指定数量禁止再启动新的脚本进程），就需要注意这个因素。


---

# 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://huataihuang.gitbook.io/cloud-atlas-draft/develop/shell/bash/backquote_and_script_process.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.
