1 2 3 4 5
#!/bin/sh x=$(ldd $SHELL|awk '$1~/^libc\./{print $3}') echo ---------------$x----------------- >&2 [ -f "$x" ] && dirname "$x" || echo /usr/lib