Usage
|
ufwhich resourcename [ path_env_name [ resource_type ] ] |
The ufwhich program searches for a given resource on a colon-separated search-path specified by a certain environment variable. It can search for a resource of either type: basically a file or a directory. It calls upon the isexist program to check for the resource in each directory on the search-path. |
When ufwhich finds what it is looking for, it outputs the full name by which the resource can be accessed. |
The first command-line argument (which is the only required one) is resourcename. It specifies the name of the resource being searched for. If this argument is the only one specified, then ufwhich acts just like Un*x's which program, only more predictably. That means that the search-path is specified by the PATH environment variable, and the resource being searched for is a file. |
The second command-line argument (the first optional one) is path_env_name. That argument specifies the name of the Environment Variable which contains the search-path. Obviously, the default for this is "PATH". |
If you specify the second argument, you can then also (if you so choose) specify a third argument. This third argument is resource_type. It specifies what kind of resource you are looking for. It does so by specifying what string the isexist program will output in the event that it finds the desired resource. The default for this argument is "FILE", which means that at-default ufwhich is looking for a file. However, if the value of this argument is "DIRECTORY", then ufwhich will look for a directory instead. |
Thanks to the ufwhich program, it is now possible to place resources on search paths other than the one specified in the PATH environment variable. That allows for more intuitive use of other pre-boxenv Un*x search-paths, such as LD_LIBRARY_PATH and MANPATH. But it also allows search-paths to be used wherever things might need to be customized. That makes ufwhich a very central program in boxenv. |