[Top][All Lists]

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

Customize the command resolution in bash?

From: Peng Yu
Subject: Customize the command resolution in bash?
Date: Fri, 11 Nov 2011 16:23:50 -0600


bash by default searchs in paths specified in the environment variable
PATH (separated by ":"). I'm not aware if there is any cache mechanism
to save the run time (but even so, different terminals still can not
see the same cache, hence each terminal has the overhead to create the
cache). When there are many files in PATH, it is going to slow down
the performance.

One simple remedy is to instead search in a file where the abspaths of
all the commands are saved (of course, this database file can be
generated by using the command 'find' to search for all the
directories in $PATH, which process can be scheduled to run
periodically using cron). To make this work, I'm wondering if there is
an easy way to customize the way that bash resolve a command.


reply via email to

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