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.

--

--

Pavol Kutaj

Today I Learnt | Infrastructure Support Engineer at snowplow.io with a passion for cloud infrastructure/terraform/python/docs. More at https://pavol.kutaj.com