> For the complete documentation index, see [llms.txt](https://kawsing.gitbook.io/opensystem/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kawsing.gitbook.io/opensystem/andoid-shou-ji/untitled-4/shell-script/untitled.md).

# 註釋多行

寫shell腳本時，經常需要註釋多行，但在每一行前輸入#有些麻煩。基於shell命令的靈活性，我們可以使用下面的方法。

### 採用HERE DOCUMENT特性

```
#!/bin/bash

echo "Hello"

<<COMMENT
註釋行1
註釋行2
...
註釋行n
COMMENT
```

### 採用：冒號:可用於多行註釋。

```
#!/bin/bash

echo "Hello"

: ' # : + 空格 + 單引號
註釋行1
註釋行2
...
註釋行n
'
```
