diff options
author | Aaron Walker <ka0ttic@gentoo.org> | 2005-07-03 14:20:43 +0000 |
---|---|---|
committer | Aaron Walker <ka0ttic@gentoo.org> | 2005-07-03 14:20:43 +0000 |
commit | 995ff330b5b0c75c25784982f911bcee69491ae0 (patch) | |
tree | 927275e7a46c1251d67507304ce9504e7b6844f0 /libs/core.bash.in | |
parent | 2005-06-19 Danny van Dyk <kugelfang@gentoo.org> (diff) | |
download | eselect-995ff330b5b0c75c25784982f911bcee69491ae0.tar.gz eselect-995ff330b5b0c75c25784982f911bcee69491ae0.tar.bz2 eselect-995ff330b5b0c75c25784982f911bcee69491ae0.zip |
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
Diffstat (limited to 'libs/core.bash.in')
-rw-r--r-- | libs/core.bash.in | 21 |
1 files changed, 15 insertions, 6 deletions
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 : |