i usually do this when I want to create docstring-like behavior
cat <<-DOC
line 1
line 2
line 3
DOC cat <<-DOC
line 1
line 2
line 3
DOCExample:
foo(){
: "This is a docstring for the foo() function"
bar --verbose | baz --quiet
}
For those who don’t know: ":" is a shell built-in command which does nothing and ignores all arguments. It was the way in which shell scripts had comments before the modern syntax of using # for comments was introduced.Colons, “:”, in batch files were, IIRC, for labels, i.e. targets for “goto” statements.