#!/bin/sh machine=`uname -m` while [ ! -z "$1" -a "$1" = "--" ] do shift done while [ ! -z "$1" ] do for d in /usr/lib/${machine}-linux-gnu/ /usr/lib/ /lib/${machine}-linux-gnu/ /lib/ do if [ -f "${d}$1" ] then echo "${d}$1" exit 0 fi done shift done exit 1