I have a file containing:
...
function myfunction(){
content
}
...
function myfunction(){
content2
}
...
How can I automatically remove the first occurrence of myfunction for every such duplica function?
You can remove local .bashrc functions with sed.
For example, to remove func1() and func2(), and keep a backup of .bashrc:
Note that it will remove simple functions that includes one block of { ... }. If you have inner { ... } blocks, extend the regexp accordingly.