The utility which
will find a program on the path but what about an arbitrary data file?
I must be searching for the wrong stuff but I can't find any way to do this with a standard utility so I thought of writing a little Bash script to do it.
The $PATH
environment variable is separated by colons, but trying to set IFS=':'
and then iterate over the results is not working for me. Here's what I've got so far:
IFS=':' DIRS=($PATH)
for d in $DIRS; do echo $d; done
At this point it only outputs the first entry in my path rather than all of them.
Thoughts? If there's already a standard command that does this then there's no reason to write a script ...
PATH
. – Mucus