How to Make Block Comments in Bash

The aim of this page📝 is to explain block commenting in Bash and Python. Making these notes during my read through the intricate Testing and Branching chapter of the Advanced Bash Scripting e-book.

Pavol Kutaj
1 min readApr 22, 2024
: <<'COMMENT'
This is a block comment.
You can write multiple lines here without affecting the script.
COMMENT
  • Python supports block comments using triple quotes for multi-line comments.
  • Example of a block comment in Python:
'''
This is a block comment.
You can write multiple lines here without affecting the script.
''
  • Bash does not have a built-in block comment feature like Python.
  • Python’s block comment syntax is more straightforward and directly supported.

--

--

No responses yet