|
|
|
Comments in shell scripts start with the |
|
|
Comments are essential for documenting your scripts. They help others (and future you) understand what the code does. |
|
|
You can use comments to:
|
|
|
Multi-line comments don’t have special syntax.
You simply start each line with |
|
|
Here’s an example of documenting a section: |
|
|
You can also use comments to disable code temporarily. This is sometimes called “commenting out” code. |
|
|
Note: There’s no block comment syntax in shell.
Some people use here-documents for multi-line
comments, but that’s a hack - just use |