From 995ff330b5b0c75c25784982f911bcee69491ae0 Mon Sep 17 00:00:00 2001 From: Aaron Walker Date: Sun, 3 Jul 2005 14:20:43 +0000 Subject: Added (base|dir)name wrapper functions which use bash instead of launching their external counterparts. Also updated bashcomp module to use these instead of ##*/ and %/* constructs. svn path=/trunk/; revision=157 --- libs/core.bash.in | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'libs/core.bash.in') diff --git a/libs/core.bash.in b/libs/core.bash.in index 0b9648a..a7e7793 100644 --- a/libs/core.bash.in +++ b/libs/core.bash.in @@ -17,12 +17,6 @@ # eselect; if not, write to the Free Software Foundation, Inc., 59 Temple # Place, Suite 330, Boston, MA 02111-1307 USA -# sed PUBLIC -# GNU sed wrapper (real path to GNU sed determined by configure) -sed() { - %SED% "$@" -} - # die [-q] "Message" PUBLIC # Display "Message" as an error. If -q is not provided, gives a stacktrace. die() { @@ -119,4 +113,19 @@ eval() { die "Don't use eval. Find another way." } +# GNU sed wrapper (real path to GNU sed determined by configure) +sed() { + %SED% "$@" +} + +# basename wrapper +basename() { + echo ${1##*/} +} + +# dirname wrapper +dirname() { + echo ${1%/*} +} + # vim: set sw=4 et sts=4 tw=80 : -- cgit v1.2.3-65-gdbad