File: source_pathconf.sh

package info (click to toggle)
xorp 1.8.5-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 28,560 kB
  • ctags: 54,995
  • sloc: cpp: 397,204; sh: 17,490; ansic: 17,029; python: 7,643; lex: 1,632; yacc: 1,474; awk: 956; makefile: 251; perl: 217; sed: 33
file content (28 lines) | stat: -rw-r--r-- 636 bytes parent folder | download | duplicates (5)
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
}