Skip to content

Instantly share code, notes, and snippets.

@whiler
Created November 29, 2021 12:21
Show Gist options
  • Save whiler/8c237c6b1351a000526d2a610c3ffdad to your computer and use it in GitHub Desktop.
Save whiler/8c237c6b1351a000526d2a610c3ffdad to your computer and use it in GitHub Desktop.
rename bash shell function
mvfunc() {
local original="$(declare -f $1)"
local newname="$2${original#$1}"
eval "${newname}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment