The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

Multi-line comments in a bash shell script

Posted by jpluimers on 2016/10/18

I’m used to multiline comments in many languages, but since I don’t use bash very often, I only recently learned it can do that too.

So this is how to have comments span multiple lines in bash by using the : command which according to the bash man page does nothing:

: [arguments]
No effect; the command does nothing beyond expanding arguments and performing any specified redirections. A zero exit code is returned.

So the syntax is:

: '
your comments here
'

–jeroen

via: Shell Script Put Multiple Line Comment.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.