[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: weird problem -- path interpretted/eval'd as numeric expression
From: |
Greg Wooledge |
Subject: |
Re: weird problem -- path interpretted/eval'd as numeric expression |
Date: |
Fri, 29 Mar 2013 07:57:39 -0400 |
User-agent: |
Mutt/1.4.2.3i |
On Fri, Mar 29, 2013 at 12:41:46AM -0700, Linda Walsh wrote:
> include was designed to search the path for functions that
> are relative paths. While the normal sourcepath allows searching for
> filenames on the search path, I don't believe (please correct if I am wrong
> and this works now, as it would make life much simpler) that the PATH will
> be searched if you give it something like:
>
> source lib/Util/sourcefile.shh
Is that all you want? Here:
include() {
local paths dir
IFS=: read -ra paths <<< "$PATH"
for dir in "${paths[@]}"; do
if [[ -r $dir/$1 ]]; then
source "$dir/$1"
return
fi
done
echo "could not find '$1' in PATH" >&2
return 1
}
- Re: weird problem -- path interpretted/eval'd as numeric expression, (continued)
- Re: weird problem -- path interpretted/eval'd as numeric expression, Greg Wooledge, 2013/03/27
- Re: weird problem -- path interpretted/eval'd as numeric expression, Linda Walsh, 2013/03/27
- Re: weird problem -- path interpretted/eval'd as numeric expression, Greg Wooledge, 2013/03/27
- Re: weird problem -- path interpretted/eval'd as numeric expression, Linda Walsh, 2013/03/27
- Re: weird problem -- path interpretted/eval'd as numeric expression, Greg Wooledge, 2013/03/27
- Re: weird problem -- path interpretted/eval'd as numeric expression, Linda Walsh, 2013/03/27
- Re: weird problem -- path interpretted/eval'd as numeric expression, Greg Wooledge, 2013/03/28
- Re: weird problem -- path interpretted/eval'd as numeric expression, Linda Walsh, 2013/03/28
- Re: weird problem -- path interpretted/eval'd as numeric expression, Dan Douglas, 2013/03/29
- Re: weird problem -- path interpretted/eval'd as numeric expression, Linda Walsh, 2013/03/29
- Re: weird problem -- path interpretted/eval'd as numeric expression,
Greg Wooledge <=
- Re: weird problem -- path interpretted/eval'd as numeric expression, Stefano Lattarini, 2013/03/29
- Re: weird problem -- path interpretted/eval'd as numeric expression, John Kearney, 2013/03/29
- Re: weird problem -- path interpretted/eval'd as numeric expression, Greg Wooledge, 2013/03/29
- Re: weird problem -- path interpretted/eval'd as numeric expression, John Kearney, 2013/03/29
- Re: weird problem -- path interpretted/eval'd as numeric expression, Pierre Gaston, 2013/03/29
- Re: weird problem -- path interpretted/eval'd as numeric expression, John Kearney, 2013/03/29
- Re: weird problem -- path interpretted/eval'd as numeric expression, Greg Wooledge, 2013/03/29
- Re: weird problem -- path interpretted/eval'd as numeric expression, John Kearney, 2013/03/29
- Re: weird problem -- path interpretted/eval'd as numeric expression, John Kearney, 2013/03/29
- Re: weird problem -- path interpretted/eval'd as numeric expression, Chet Ramey, 2013/03/30