1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
#!/bin/sh
#
# This is an example of how to find and source the pathconf shell script.
# The latter sets path related variables.
#
#
# source_pathconf [ <search_start_dir> ]
#
# Search for and source pathconf.sh shell script. By default the the
# search starts in the present working directory (as specified by
# $PWD). This may be overridden by specifying a <search_start_dir>.
#
source_pathconf()
{
local sdir sfile
sdir=${1:-${PWD}}
while test ! ${sdir} -ef "/" ; do
sfile=${sdir}/utils/pathconf.sh
if [ -f ${sdir}/utils/pathconf.sh ] ; then
. ${sfile}
return 0
fi
sdir=${sdir}/..
done
return 1
}
|