From 5d7afce57124eeea93c7199df3b597cdfcc3f8ec Mon Sep 17 00:00:00 2001 From: Marissa Staib Date: Wed, 25 Sep 2019 16:42:17 -0400 Subject: [PATCH] Update .bash_aliases --- .bash_aliases | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.bash_aliases b/.bash_aliases index 4bf0e3d..72d8e5d 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -43,6 +43,15 @@ function bashreload() source "$HOME"/.bashrc } +# from https://stackoverflow.com/a/1203628 +# Useful for overriding functions defined in these common scripts +# Usage: copy_func from to +function copy_func() +{ + declare -F $1 > /dev/null || return 1 + eval "$(echo "${2}()"; declare -f ${1} | tail -n +2)" +} + function scriptupdate() { (