Is there a way to access docstrings in Bash? How does one include a docstring in a function's definition in Bash?

More specifically how do I add and access docstrings to the following function?

    funky() {
    echo "Violent and funky!"

If you mean "Bash's equivalent of Python's docstrings" I'm afraid I have to disappoint you that there is no such thing.

However.. I must say that implementing an equivalent of the "docstrings" feature would make for a very interesting homework in order to learn Bash's programmable-completion facility along with how to override a builtin command such as help to display either such "docstrings" or the normal builtin help's output.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.