summaryrefslogtreecommitdiff
path: root/util/find.sh
diff options
context:
space:
mode:
authorJay Freeman <saurik@saurik.com>2008-04-06 10:28:29 +0000
committerJay Freeman <saurik@saurik.com>2008-04-06 10:28:29 +0000
commitd699a01fabaa04a1aad60f6ca5777f82ee24839a (patch)
tree1eb62bad23b14a0877c5b9171f2a5f9358c8d592 /util/find.sh
parent8a49e427447f40fdd43fc4b5f513b166dd639e2a (diff)
Drastic, sweeping modifications to support iPhone 1.2.0/2.0.
git-svn-id: http://svn.telesphoreo.org/trunk@199 514c082c-b64e-11dc-b46d-3d985efe055d
Diffstat (limited to 'util/find.sh')
-rwxr-xr-xutil/find.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/util/find.sh b/util/find.sh
new file mode 100755
index 000000000..d45bea76b
--- /dev/null
+++ b/util/find.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+#echo 1>&2
+#echo ::: find.sh "$@" 1>&2
+
+while [[ $# -ne 0 ]]; do
+ if [[ $1 == /* ]]; then
+ unset found
+
+ found=$(echo "${PKG_PATH}:" | while read -r -d ':' path; do
+ if [[ -e ${path}$1 ]]; then
+ if [[ ${found+@} ]]; then
+ echo -n ':'
+ else
+ found=
+ fi
+
+ echo -n "${path}$1"
+ fi
+ done)
+
+ #echo "=== ${found:=$1}" 1>&2
+ echo "${found:=$1}"
+ else
+ echo "$1"
+ fi
+
+ shift
+done
+
+#echo 1>&2