> For the complete documentation index, see [llms.txt](https://bash.netdpi.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bash.netdpi.net/di-er-bu-ji-chu/te-shu-zi-yuan.md).

# 第三章、特殊字元

字元會有什麼特別的呢？如果字元超出本身詞彙上所具備的意義，那麼我們會把這樣的字元稱為特殊字元。除了指令與關鍵字之外，特殊字元也是Bash script 的組成之一。

在 script 與其他地方找到的特殊字元

\#

**註解 (comment).** 以 # 開頭那一行都是註解，所以不會執行這行的內容（#! 開頭的例外)

```bash
# This line is a comment.
```

註解也可以放在指令結尾

```bash
echo "A comment will follow." # Comment here.
#                            ^ Note whitespace before #
```

註解也可以放在空白後面

```bash
     # A tab precedes this comment.
```

註解甚至可以嵌入在管線（pipe）裡面

```bash
initial=( `cat "$startfile" | sed -e '/#/d' | tr -d '\n' |\
# Delete lines containing '#' comment character.
           sed -e 's/\./\. /g' -e 's/_/_ /g'` )
# Excerpted from life.sh script
```

註解可能不能放在同一行的註解後面，註解沒有結束的方式，所以為了「確定程式碼可以執行」，還是建議把註解放在一行的開頭，然後把指令放到在下一行。

（TBC)

; 指令分隔符號（分號），允許將兩個或多個指令放在同一行上。

```bash
echo hello; echo there


if [ -x "$filename" ]; then    #  Note the space after the semicolon.
#+                   ^^
  echo "File $filename exists."; cp $filename $filename.bak
else   #                       ^^
  echo "File $filename not found."; touch $filename
fi; echo "File test complete."
```

(TBC)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://bash.netdpi.net/di-er-bu-ji-chu/te-shu-zi-yuan.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
