You are not logged in.
Pages: 1
I have a file with a bunch of functions like:
foo_dfljksdfk() {
}
foo_sdljkasd() {
}
foo_ladlafsd() {
}
So all functions start with "foo_" and have some sort of name afterwards.
I want to be able to extract a given function. I thought something like
awk '/foo_name()/,/foo_....()/'
would be the way to go, but I do not know how to do the second regex. I.e. name any foo_***() but not foo_name().
Any suggestions?
Offline
Try
'!/foo_ladlafsd()/ && /foo_....()/'
Offline
Hmm... that works... Thanks!
But I found an even simpler way. "type foo_sdfsasfd" in bash will echo the function. And given the file is already sourced, that will make like easy!
Offline
Pages: 1