Hello awk ninjas I need some help, so I found a solution to print defined function names from my shell script from here but my issue I would love my functions to show the comments... here is an example of how my functions are defined.
function1() { # this is a function 1
          command1
        }
function2() { # this is a function 2
          command2
        }
function3() { # this is a function 3
          command3
        }
So the command provided that works is this one: typeset -f | awk '/ \(\) $/ && !/^main / {print $1}' and the output will be this:
function1
function2
function3
But I would love the output to be this way (a 4 space between the function name and comment would be really nice also):
function1    # this is a function 1
function2    # this is a function 2
function3    # this is a function 3
Thank you in advance.
 
     
     
    