help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] How to use loadables?


From: Peng Yu
Subject: Re: [Help-bash] How to use loadables?
Date: Fri, 14 Dec 2018 10:36:37 -0600

On Fri, Dec 14, 2018 at 10:17 AM Chet Ramey <address@hidden> wrote:
>
> On 12/13/18 2:23 PM, Peng Yu wrote:
> > Hi,
> >
> > I just want to use loadables but I don't want to compile the whole
> > bash source code. What is the most convenient way to just compile
> > these files and use them? Thanks.
>
> The most convenient way is to build bash from source, so you have
> access to config.h, and then run `make' in the loadables directory.
>
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
>                  ``Ars longa, vita brevis'' - Hippocrates
> Chet Ramey, UTech, CWRU    address@hidden    http://tiswww.cwru.edu/~chet/

OK. Thanks.

I feel like loadables are little known by most people. For example, if
one search for getting abspath in bash, s/he will usually be directed
to commands from coreutils. Yet, loadables/realpath is much faster due
to its little startup time for inputs without too many entries. Most
built-in commands should be faster than external programs for typical
uses.

https://www.google.com/search?q=bash+abspath

I think the `loadables/` is better to be made standalone as it should
be dependent upon a small subset of bash so that people can
independently develop more loadables without having to always use the
whole bash source tree.

I'm not familiar with the bash source organization. Will you (or
somebody who is more familiar with the bash source) be able to
separate the minimal part dependent by loadables into a separate
repository for later easy expansion? Thanks.


enable -f ~/Downloads/bash-4.4/examples/loadables/realpath realpath
time for ((i=0;i<1000;++i)); do
    realpath .
done > /dev/null

real    0m0.033s
user    0m0.020s
sys    0m0.012s

time for ((i=0;i<1000;++i)); do
    readlink -e .
done > /dev/null

real    0m5.828s
user    0m1.774s
sys    0m2.640s

-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]