#!/bin/sh

LDPATH="`cat /etc/ld.so.conf` `echo $LD_LIBRARY_PATH|tr ':' ' '`"
for i in $LDPATH; do
    echo $i:
    j=`echo $i | sed 's|/|\\\/|g'`
    # want links unless vfat - note df test doesn't work on ram
    if df $i | grep -vq Mounted; then
	if mount | grep `df $i | tail -n1 | cut -c57-90` | awk '{print $5}' | grep -q "vfat" ; then
	    find $i/ -type f -name '*.so*' | xargs ls -l  | sed "s/.* $j\//	/" | grep -v '/' | sort
	fi
    else
	    find $i/ -type l -name '*.so*' | xargs ls -l  | sed "s/.* $j\//	/" | sort
    fi
done
