Can bash show a function’s definition?

Use type. If foobar is e.g. defined in your ~/.profile:

$ type foobar
foobar is a function
foobar {
    echo "I'm foobar"
}

This does find out what foobar was, and if it was defined as a function it calls declare -f as explained by pmohandras.

To print out just the body of the function (i.e. the code) use sed:

type foobar | sed '1,3d;$d'

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)